From 278aae7c7d5c54e0f9b462e53063092bc51691cd Mon Sep 17 00:00:00 2001 From: Thammi Date: Thu, 15 Aug 2013 02:12:41 +0200 Subject: [PATCH] Adjust test code to new hardware --- fw_test/main.c | 215 ++++++++++--------------------------------------- 1 file changed, 41 insertions(+), 174 deletions(-) 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; }