I want to begin with simple example problem....I created a led blink interface with u-controller and led..i wrote a code like this
problem is that wehen i connecte nothing to the pin....no push button ...no vcc no gnd....the output pin...or the led is flickering...the led should turn on if pin input is 5v and off when none right....do i need to ground the pin to turn it off otherwise...like pulldown to ground or something by default......please i need some experienced tips...thanks in advance
PS:
chip-ATMEGA32
Rich (BB code):
while (1)
{
// when port B pin 3 is high light led else turn it off PORTA =0b10101010;
if(PINB&(1<<PB3))
{
PORTA =0b1000000;
}
else
{
PORTA =0b00000000;
_delay_ms(200);
}
}
PS:
chip-ATMEGA32
Last edited by a moderator: