Skip to content

Commit

Permalink
Example code: hard coded values -> define (#303)
Browse files Browse the repository at this point in the history
* ws2812fx_segments_OTA: hard code values -> define

Use of defines instead of hard coded values

* ws2812fx_segments_web: hard code values -> define
  • Loading branch information
FedericoBusero authored Dec 6, 2021
1 parent 13bddde commit 506354b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/ws2812fx_segments_OTA/ws2812fx_segments_OTA.ino
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void setup() {
ws2812fx.setBrightness(127);

// parameters: index, start, stop, mode, color, speed, reverse
ws2812fx.setSegment(0, 0, 29, 9, (const uint32_t[]) {0xff0000, 0x000000, 0x000000}, 1000, false);
ws2812fx.setSegment(0, 0, LED_COUNT-1, FX_MODE_SINGLE_DYNAMIC, (const uint32_t[]) {0xff0000, 0x000000, 0x000000}, 1000, false);
ws2812fx.start();
}

Expand Down
2 changes: 1 addition & 1 deletion examples/ws2812fx_segments_web/ws2812fx_segments_web.ino
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct Preset {
int brightness = 64;
int numSegments = 1;
WS2812FX::Segment segments[MAX_NUM_SEGMENTS] = {
{0, LED_COUNT - 1, 1000, 0, 0, {RED, GREEN, BLUE}}
{0, LED_COUNT - 1, 1000, FX_MODE_STATIC, NO_OPTIONS, {RED, GREEN, BLUE}}
};
};
Preset preset; // note: "preset" is a Preset data struct
Expand Down

0 comments on commit 506354b

Please sign in to comment.