#include #include #include #include #include #include "main.h" uint16_t sw_v = 0; uint16_t darkness = 0; uint16_t darkval = 0; uint16_t last_darkval = 0; void __attribute__((noreturn)) main(void) { /* here the show begins:*/ DDRC = 0b00100011; PORTC = 0b00000001; PORTC = 0b00000000; DDRD = 0x00; PORTD = 0b00000011; //enable pullups DDRB = 0xFF; PORTB=0xFF; /* set timer2 to CTC & prescaler 64 → ???125kHz increment */ TCCR2A = (1 << WGM21); TCCR2B = (1 << CS20)|(1 << CS21); OCR2A = 0x3F; /* TOP */ TCNT2 = 0; /*enable interrupt*/ TIMSK2 |= (1<