Microcontroller › AVR › help in input of atmega 8l › Hi AhmetMake sure that you
October 17, 2016 at 7:17 am #14199
Make sure that you are defining a particular pin/port as input, also after that declare whether it is pulled up or not. Go as follows:
DDRC & = ~(1<<0); // defined PORTC's 0 pin as i/p pin
PORTC | = (1<<0); // declared it as a pulled up i/p pin
Now if you try reading this pin's value it will give you a high state unless any logic 0 is applied to it externally, this is because its pulled up.
This might help, good luck