#include #include #include #include // this lets us refer to data in program space (i.e. flash) #define DEBUG const char music[] PROGMEM = /* 1 (drum pickup) 2 (intro, 1st half) 3 (intro, 2nd half) 4 we're no strangers to love 5 you know the rules and so do i (do i do i) 6 a full commitment's what i'm thinking of 7 you wouldn't get this from any other guy 8 i just wanna tell you how i'm feeling 9 gotta make you understand 10 never gonna give you up 11 never gonna let you down 12 never gonna run around and desert you 13 never gonna make you cry 14 never gonna say goodbye 15 never gonna tell a lie and hurt you */ "! O4 T114 L16 V13 MS c+drc+cc 112) { // 112 + pickup TIMSK0 = 0; // disable interrupt set_motors(0, 0); } else { #ifdef DEBUG clear(); lcd_goto_xy(0, 0); print_long(beat_count); #endif // turn on led if(led_select) { red_led(1); } else { green_led(1); } set_motors(left_motor_speed[beat_count], right_motor_speed[beat_count]); beat_timeout = BEAT_TIMEOUT_START; if ((beat_timeout & 0x3) == 0) beat_timeout++; // effective beat_timeout = 5140.25 } } else if (beat_timeout == 4500) { //turn off led if(led_select) { red_led(0); } else { green_led(0); } led_select = !led_select; } beat_timeout--; }