Hi, I am using 89v51rd2 controller,,i wanted to blink an led on board using tsop sm0038 ir reciever,the code which i used for this is
sbit TSOPSEN= P3^4; //Input from TSOP sensor sbit LED = P0^4; //Output display from TSOP sensor
void main() { while (1) { LED=0; if(TSOPSEN == 1) { LED=1; } } } but wen i dumped the code and pressed the remote,the led is not blinking
Oh dear.
So, what are you going to do about it?
Interesting loop:
while (1) { LED=0; if(TSOPSEN == 1) { LED=1; } }
You sure that your loop should always (!) set LED=0 and then conditionally change its mind and set LED=1? What would happen if your TSOPSEN pin is constantly high - wouldn't you then expect LED to also be constantly high?
By the way - exactly where are you stuck?
What form of debugging have you performed?
What was the result of your debugging? What did you expect, and what did actually happen? What conclusions did you make from the difference between what you expected and what you got? What plans do you have to try to overcome these differences?
sir, what i wanted was to make a led blink on providing a signal from my tv remote,,but when i tried burning this code into my controller, it never blinked on the signal
And then you spent some time trying to figure out what could be wrong?
ya spent some time on it ,but since i am new to 8051 programming,i couldnt find wats the problem,,i changed the code to Hi, I am using 89v51rd2 controller,,i wanted to blink an led on board using tsop sm0038 ir reciever,the code which i used for this is
#include<reg51.h> sbit TSOPSEN= P0^0; //Input from TSOP sensor sbit LED = P1^4; //Output display from TSOP sensor
void main() { while (1) { if (TSOPSEN==0)
{ LED=0; } else if(TSOPSEN == 1) { LED=1; } } } but still get the same problem,led nt blinking
ya ... nt hw wl LED blk wn - blk enbl