From 85f143f54c40c7c3b49e0510530afde7173066ab Mon Sep 17 00:00:00 2001 From: bigalex Date: Thu, 27 Sep 2012 18:45:02 +0200 Subject: [PATCH] working test firmware (yes, setting the pullups is a good idea) --- fw_test/main.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/fw_test/main.c b/fw_test/main.c index de79761..5b3f951 100644 --- a/fw_test/main.c +++ b/fw_test/main.c @@ -79,6 +79,7 @@ static void set_motor(int val){ static void init_switch(void){ DDRD &= ~( (1 << PORTD1) | (1< 3) mode =3; flashleds(LED_L); break; - case 1: //right switch pressed - mode = (mode-1) % 4; + 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; }