From 86a97f4873ba6eddba5e96b17b0d839cef89387f Mon Sep 17 00:00:00 2001 From: Thammi Date: Thu, 29 Aug 2013 21:48:05 +0200 Subject: [PATCH] fw test: Flash in photon mode and improved documentation --- fw_test/README.md | 2 +- fw_test/main.c | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/fw_test/README.md b/fw_test/README.md index 04fdd30..aa924df 100644 --- a/fw_test/README.md +++ b/fw_test/README.md @@ -7,7 +7,7 @@ The following things exist in all modes: * right LED is on when IR signals are received (use a remote or first mode to test) -* pressing the right button activates next mode +* pressing the right button activates next mode, plays a sound using BUZZR Here is a description what happens on a right button press in which mode: diff --git a/fw_test/main.c b/fw_test/main.c index 81947af..12b2fdc 100644 --- a/fw_test/main.c +++ b/fw_test/main.c @@ -49,7 +49,7 @@ static void reset_hw(void) { // 2: SHIELD // 7: BUZZR PORTB = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 7); - DDRB = (1 << 2) | (1 << 7); + DDRB = (1 << 2) | (1 << 6) | (1 << 7); // 0: BUZGND // 2: LED2 @@ -71,6 +71,7 @@ static void reset_hw(void) { int main(void) { uint8_t vib_delay = 0; + uint16_t count = 0; // we need to get real fast (8MHz) to handle 38kHz IR frequency ... @@ -136,9 +137,14 @@ int main(void) { switch(mode) { case PHOTONS: - ir_active = button; - follow(button, PORTD, 4); - break; + { + ir_active = button; + if(count % 0x2000 == 0) { + PORTD ^= 1 << 4; + } + ++count; + break; + } case MOTOR: not_follow(button, PORTB, 6); break;