From 4ace66bc02b7767343a6bcc643af64844dd98889 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 3 Jun 2016 23:22:04 +0200 Subject: added color blinks, removed all printf's --- firmware/blinkyfications.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/firmware/blinkyfications.cpp b/firmware/blinkyfications.cpp index ffb4654..2bdea1f 100644 --- a/firmware/blinkyfications.cpp +++ b/firmware/blinkyfications.cpp @@ -73,21 +73,23 @@ ISR(TIMER1_COMPA_vect) void handle_cmd(uint8_t cmd) { switch(cmd) { - case '0': fill_solid(leds, NUM_LEDS, CRGB::Black); FastLED.show(); break; - case '1': fill_solid(leds, NUM_LEDS, CRGB::White); FastLED.show(); break; - case 'r': fill_solid(leds, NUM_LEDS, CRGB::Red); FastLED.show(); break; - case 'g': fill_solid(leds, NUM_LEDS, CRGB::Green); FastLED.show(); break; - case 'b': fill_solid(leds, NUM_LEDS, CRGB::Blue); FastLED.show(); break; - case 'w': fill_rainbow(leds, NUM_LEDS, 0, 256/NUM_LEDS); FastLED.show(); break; + case '0': fill_solid(leds, NUM_LEDS, CRGB::Black); FastLED.show(); break; + case '1': fill_solid(leds, NUM_LEDS, CRGB::White); FastLED.show(); break; + case 'r': fill_solid(leds, NUM_LEDS, CRGB::Red); FastLED.show(); break; + case 'g': fill_solid(leds, NUM_LEDS, CRGB::Green); FastLED.show(); break; + case 'b': fill_solid(leds, NUM_LEDS, CRGB::Blue); FastLED.show(); break; + case 'w': fill_rainbow(leds, NUM_LEDS, 0, 256/NUM_LEDS); FastLED.show(); break; - case '.': fill_solid(leds, NUM_LEDS, CRGB::White); FastLED.show(); timer_start(10 * _10MS_); break; - case 'o': fill_solid(leds, NUM_LEDS, CRGB::White); FastLED.show(); timer_start(30 * _10MS_); break; - case 'O': fill_solid(leds, NUM_LEDS, CRGB::White); FastLED.show(); timer_start(100 * _10MS_); break; + case '.': fill_solid(leds, NUM_LEDS, CRGB::White); FastLED.show(); timer_start(10 * _10MS_); break; + case 'o': fill_solid(leds, NUM_LEDS, CRGB::White); FastLED.show(); timer_start(30 * _10MS_); break; + case 'O': fill_solid(leds, NUM_LEDS, CRGB::White); FastLED.show(); timer_start(100 * _10MS_); break; + + case 'R': fill_solid(leds, NUM_LEDS, CRGB::Red); FastLED.show(); timer_start(10 * _10MS_); break; + case 'G': fill_solid(leds, NUM_LEDS, CRGB::Green); FastLED.show(); timer_start(10 * _10MS_); break; + case 'B': fill_solid(leds, NUM_LEDS, CRGB::Blue); FastLED.show(); timer_start(10 * _10MS_); break; case '!': reset2bootloader(); break; - default: printf("error\r\n"); return; } - printf("ok\r\n"); } int main(void) -- cgit v1.2.3