Thursday, 13 August 2015

LED TOGGLE PROGRAM CODE ON 8051



LED TOGGLE

LED (Light Emitting Diodes) are simple lights that you can turn ON/OFF. They glow when they are ON and they don't when they are not. They look somewhat familiar to the picture below

Standard RED LEDs

Program Code:
C LANGUAGE CODE



The delay function used in this code is also a general one and it roughly provides the required delay in milliseconds as defined by the input parameter. So we are talking of one second when we say delay(1000). You can use this function for now but don't ever use it when timing is crucial and you need more accuracy. 

Here is the simulation design for PROTEUS that I used. As I said, I wouldn't care much about the resistor. Neither in the simulation nor in practical scenario.

PROTEUS SIMULATION DESIGN

I have also included the design file in the download package. I hope that this post has given you an idea of how things are done in real. It gets easier with practise. Any suggestion/feedback is highly appreciated as I might have missed something. Remember that there is always an easier way around in programming so I encourage you to learn, understand and then venture on your own adventure. Goodluck for the implementation. 














1 comment: