From ccf0497c35fcb2300b016f26326c11174d0afe1a Mon Sep 17 00:00:00 2001 From: Thammi Date: Thu, 5 Sep 2013 22:15:28 +0200 Subject: [PATCH] Make blinker simpler --- firmware/apps/blinker.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/firmware/apps/blinker.c b/firmware/apps/blinker.c index 78f7e49..fc45329 100644 --- a/firmware/apps/blinker.c +++ b/firmware/apps/blinker.c @@ -11,18 +11,16 @@ static void blinker(void) { led_inv(RIGHT); led_inv(LEFT); - uint8_t i; - for(i = 0; i < 50; ++i) { - if(button_clicked(RIGHT)) { - motor_on(); - } + wait_ms(500); - if(button_clicked(LEFT)) { - motor_off(); - } - - wait_ms(10); + if(button_clicked(RIGHT)) { + motor_on(); } + + if(button_clicked(LEFT)) { + motor_off(); + } + } REGISTER(blinker, init, NULL);