Hi folks I'm new to AVR, and microproccors, and I was wondering why inverse logic is used?
For me On is 1 HIGH or 5v or what ever VCC is and 0 or Off is 0 zero volts, but I came across this beginners example.
The program flashes a led on and off.
/* led on, pin=0 */ PORTD &= ~(1<<PD5); delay_ms(500); /* set output to 5V, LED off */ PORTD|= (1<<PD5); delay_ms(500); My setup is Pin PD5 to 1k current limiting resistor to led then to GND. The program runs fine, but the inverse logic bugs me. Seems to be a layer of added strangeness. Cheers Rich