Programming: Initializing 7 LEDs and a Button on PORTB and the Same for PORTD

A Push Button and 7 LEDs are Initialized on PORTD and PORTB. The Push Button is located on the 8th pin (pin 7) on each port and the 7 LEDs are located on the remaining pins of each port.



Initialization code: DDRB = 0b01111111; DDRD = 0b01111111; PORTB = 0b10000000; PORTD = 0b10000000;
Back to blog

Leave a comment

Please note, comments need to be approved before they are published.