diff --git a/fw_test/main.c b/fw_test/main.c index e3ea38a..357a4a9 100644 --- a/fw_test/main.c +++ b/fw_test/main.c @@ -5,203 +5,70 @@ #include #include +#define ever (;;) -#define LED_L (1 << PORTC0) -#define LED_R (1 << PORTC2) -#define MOTOR_ON (0< 3) mode =3; - flashleds(LED_L); - break; - case 0b00000001: //right switch pressed - mode++; - if (mode > 3) mode = 0; - flashleds(LED_R); - break; - case 0b00000000: //both switches pressed - flashleds(LED_R|LED_L); - break; + // lower buzzer + vib_delay ^= 1; + if(!(PIND & (1 << 7))) { + if(vib_delay) { + PORTC ^= 1 << 0; + } + } else { + PORTC &= ~(1 << 0); } + // wait + + _delay_ms(1); } + /* never return 0; */ return 0; }