I wrote the code for it in keil.The simulation worked perfectly but the hardware implementation for the same is not working properly.Please help
< #include<reg51.H> sbit IN = 0x91; sbit OUT = 0xA1; void main() { P1=0xFF; P2=0x00; while(P1_1==1) { P2_1=1; } while(P1_1!=1) { P2_1=0; } }
Yup. Per is Right.
My suggestion was intended to just get the LED ON and OFF (independent of the status of the switches). To ensure LED turn On and turn OFF is successful, hence the hardware is working.