This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

reg tsop interfacing

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

Parents
  • 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?

Reply
  • 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?

Children