mirror of
https://gitlab.com/wirelos/sprocket-lib.git
synced 2025-12-16 13:25:03 +01:00
add color modes
This commit is contained in:
@@ -9,9 +9,12 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace std::placeholders;
|
using namespace std::placeholders;
|
||||||
|
|
||||||
|
enum PIXEL_MODES {RED = 0xFF0000, GREEN = 0x00FF00, YELLOW = 0xffff00, BLUE = 0x0000FF, ORANGE = 0xffa500};
|
||||||
|
|
||||||
struct NeoPixelConfig {
|
struct NeoPixelConfig {
|
||||||
int pin;
|
int pin;
|
||||||
int length;
|
int length;
|
||||||
|
int mode;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Illucat : public Sprocket {
|
class Illucat : public Sprocket {
|
||||||
@@ -31,7 +34,11 @@ class Illucat : public Sprocket {
|
|||||||
|
|
||||||
void messageReceived( uint32_t from, String &msg ) {
|
void messageReceived( uint32_t from, String &msg ) {
|
||||||
Serial.printf("illucat: received from %u msg=%s\n", from, msg.c_str());
|
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){
|
void setHexColor(const char *hex){
|
||||||
int r, g, b;
|
int r, g, b;
|
||||||
|
|||||||
Reference in New Issue
Block a user