add color modes

This commit is contained in:
2018-06-30 10:50:48 +02:00
parent c156002332
commit a5cffc9bce

View File

@@ -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;