From a5cffc9bce2b9123ca76f45f32eb85331b7d492f Mon Sep 17 00:00:00 2001 From: Patrick Balsiger Date: Sat, 30 Jun 2018 10:50:48 +0200 Subject: [PATCH] add color modes --- src/examples/illucat/Illucat.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/examples/illucat/Illucat.h b/src/examples/illucat/Illucat.h index dbc80fa..08a89b9 100644 --- a/src/examples/illucat/Illucat.h +++ b/src/examples/illucat/Illucat.h @@ -9,9 +9,12 @@ using namespace std; using namespace std::placeholders; +enum PIXEL_MODES {RED = 0xFF0000, GREEN = 0x00FF00, YELLOW = 0xffff00, BLUE = 0x0000FF, ORANGE = 0xffa500}; + struct NeoPixelConfig { int pin; int length; + int mode; }; class Illucat : public Sprocket { @@ -31,7 +34,11 @@ class Illucat : public Sprocket { void messageReceived( uint32_t from, String &msg ) { Serial.printf("illucat: received from %u msg=%s\n", from, msg.c_str()); - setHexColor(msg.c_str()); + setColor(msg.c_str()); + } + void setColor(const char *color){ + pixels->ColorSet(BLUE); + pixels->show(); } void setHexColor(const char *hex){ int r, g, b;