mirror of
https://gitlab.com/zwirbel/illucat.git
synced 2025-12-16 01:58:47 +01:00
load pixel config from json file
This commit is contained in:
@@ -10,12 +10,26 @@
|
||||
// TODO move ARRAY_LENGTH to core lib
|
||||
#define ARRAY_LENGTH(array) sizeof(array)/sizeof(array[0])
|
||||
|
||||
struct NeoPixelConfig {
|
||||
struct NeoPixelConfig : public JsonStruct {
|
||||
int pin;
|
||||
int length;
|
||||
int brightness;
|
||||
int updateInterval;
|
||||
int defaultColor;
|
||||
void mapJsonObject(JsonObject& root) {
|
||||
root["pin"] = pin;
|
||||
root["length"] = length;
|
||||
root["brightness"] = brightness;
|
||||
root["updateInterval"] = updateInterval;
|
||||
root["defaultColor"] = defaultColor;
|
||||
}
|
||||
void fromJsonObject(JsonObject& json) {
|
||||
pin = getIntAttrFromJson(json, "pin");
|
||||
length = getIntAttrFromJson(json, "length");
|
||||
brightness = getIntAttrFromJson(json, "brightness");
|
||||
updateInterval = getIntAttrFromJson(json, "updateInterval");
|
||||
defaultColor = getIntAttrFromJson(json, "defaultColor");
|
||||
}
|
||||
};
|
||||
|
||||
struct NeoPatternDto : public JsonStruct {
|
||||
Reference in New Issue
Block a user