#include #include #include #include #include #include "main.h" #include "lib/synth.h" #include "lib/usart.h" #include "lib/bughal.h" uint16_t sw_v = 0; uint16_t darkness = 0; uint16_t darkval = 0; uint16_t last_darkval = 0; static void init_sampletimer(void) { /* * Timer 0 */ /* set timer0 to CTC & prescaler 64 → 125kHz increment */ TCCR0A = (1 << WGM01); TCCR0B = (1 << CS00) | (1 << CS01); OCR0A = 6; /* TOP */ TCNT0 = 0; /*enable interrupt*/ TIMSK0 |= (1<