Hello,
I am trying to use an input, but seems thatI'm doing something wrong here.
I tried to turn on some ouput (where I connected a led thatI already tested
as output)
when I read an input high.
My output is always off (seems that I'm unable to read input from portc.
What am I doing wrong here ?
TIA
My CPU is AT90S8515
int main()
{
unsigned int i;
unsigned char c ;
// enable all bits of PORTA as outputs
DDRA = 0xff;
// enable all bits of PORTC as inputs
DDRC = 0x00;
while (1) {
if (PORTC)
PORTA = 0xFF ;
else
PORTA = 0 ;
}
return 0;
}
_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list