8051 micro-controller is a basic 8 bit micro-controller to learn by any electronics lover. Using the application of this micro-controller makes an individual more relevant to this controller and interfacing with other modules.
LED blinking using LDR interfacing 8051 micro-controller is not a tough task. If you are trained in C programming you can derive your own concept instead of using and copying the code. But, for your help, I am providing you code of LDR with LED blinking..and the other concept you will get after reading if you have worked before on this.
I would prefer you to make your own program using your concept. It will discover new way of making a program but also develop your writing coding skills. Before using this code, You should clear your concept in LED interfacing with LDR. Light Dependent Resistor which is a type of a resistor works on the fall of light. The simple concept of LDR is that when light falls on the LDR forming circuit, the circuit gets ON means no resistance. If light does not fall on the LDR, it switches OFF the circuit. This means it acts a switch for the circuit in which it is used.
LED blinking using LDR interfacing 8051 micro-controller is not a tough task. If you are trained in C programming you can derive your own concept instead of using and copying the code. But, for your help, I am providing you code of LDR with LED blinking..and the other concept you will get after reading if you have worked before on this.
Led using LDR
#include "REG52.h" //Declare header file #define LED P3 //Defining the port P3 sbit LDR=P0^0; //Defining a pin of port P0 long int i; void main() //Main function defined with return value { while(1) //infinite loop { if(LDR==0) LED=0xFF; else //equal to { if(LDR==1)} { LED=0x00; for(i=0;i<7500;i++); //Delay LED=0xff; for(i=0;i<7500;i++); //Delay } } }
Led using ldr in embedded c
ReplyDelete