Hi I'm still new to this all but learning. I currently have an atmega 168 and I'm trying to detect ground on port C pin 4. Here is my attempt
DDRC &= ~0x10; // sets pin 4 to out PORTC |= 0x10; //enable pull on pin 4 _delay_ms(10); // settle ( not sure if this is needed) int testPin = (PINC & 0x10); blinkLed (testPin);
Where did I go wrong? Or is this an over kill?
Thx as always.