//if external PB0 is pressed leds 0,3,4,7 will turn on
#include <stdint.h>
#define DDRA (*(volatile uint8_t*)0x21)
#define PORTA (*(volatile uint8_t*)0x22)
#define PINB (*(volatile uint8_t*)0x23)
#define DDRB (*(volatile uint8_t*)0x24)
int main(void){
DDRA = 0xFF;
DDRB = 0x00;
while(1){
if (PINB & (1 << 0)) { // PB0 pressed (external pull-down)
PORTA = 0x99; // LEDs 0,3,4,7 ON
} else {
PORTA = 0x00;
}
}
}