summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2016-06-03 23:22:04 +0200
committerChristian Pointner <equinox@spreadspace.org>2016-06-03 23:22:12 +0200
commit4ace66bc02b7767343a6bcc643af64844dd98889 (patch)
tree26eb4e6e8efacc10539b4647db8be40ac17af779
parentadded simple blink commands to firmware (diff)
added color blinks, removed all printf's
-rw-r--r--firmware/blinkyfications.cpp24
1 files 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)