- This topic has 2 replies, 3 voices, and was last updated 12 years, 3 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 › IR sensor not working as expected in atmega 32
hey friends i am trying to interface an ir sensor wih atmega 32 which gives a ttl output such that when an obsatcle is detected it glow the led. but sadly the led glows all the time. i want it to glow only when the obstacle is detected.
here is the code
#include
#include
void main()
{
DDRA=0xf0;// PA0 is the input
// PA7 is the led pin
while(1)
{
if(PINA & 0b00000001)
{
PORTA=0x80;
_delay_ms(10);
PORTA=0x00;
_delay_ms(10);
}
}
}
Hi Subham,
Kindly share your schematics to verify.
Please post your circuit diagram also.