fix input logic (pull-up) + add GPIO notes

This commit is contained in:
Pratik
2026-04-03 17:14:04 +11:00
parent 2c9714c851
commit ba12279c6a
3 changed files with 273 additions and 1 deletions

View File

@@ -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);