fix input logic (pull-up) + add GPIO notes
This commit is contained in:
@@ -14,7 +14,7 @@ int main(void) {
|
||||
|
||||
while(1) {
|
||||
// Button pressed -> pin reads LOW because of pull-up
|
||||
if (PINB & (1<<PB3)) {
|
||||
if (!(PINB & (1<<PB3))) {
|
||||
for (int i=0;i<=20;i++){
|
||||
PORTB |= (1<<PB2); // LED ON
|
||||
delay_ms(200);
|
||||
|
||||
Reference in New Issue
Block a user