#Microcontrollers LED Switch Interfacing with 8051

// In Embedded C:

/*
Interfacing
Connect LED_Switch Board CN1 to CN5 of Micro51S Board
Connect LED_Switch Board CN2 to CN4 of Micro51S Board
*/


#include <reg51.h>  
#define SWITCH_PORT P3
#define LED_PORT P2

int main()
{
SWITCH_PORT = 0xFF;
LED_PORT = 0x00;
while(1)
{
LED_PORT = SWITCH_PORT;
}
}



Comments