- This topic has 2 replies, 3 voices, and was last updated 8 years, 2 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
|
Microcontroller › AVR › Basic interfacing of tsop ir receiver with Atmega16
Hello,
I have a Atmega16 and a Tsop ir reciever. All I want to do is, glow a led, when the receiver gets a signal, from any standard tv remote.
Here’s the code outline, i have tried
ddrb=0x00// part b as input, where i have connected tsop receiver to pb0
portb=0xff// pulling up part b
ddrd=0xff// part d as output, where i have a led in pd0
while(1)
{
if(pinb)// i get some value at the reciever
portd|=0b00000001<<pd0;
else
portd=0b00000000;
}
Sorry for mixing up hex and binary forms…I am a newbie trying out things. Kindly guide me through this problem!
Thanks in advance
So tell us about the output that you are getting.
the TSOP sensor output is normally high and it goes low when it detects signal. also check for signal change on any single pin only not whole port.