You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-17Lines changed: 9 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,14 +63,7 @@ void setup() {
63
63
64
64
// ~ Configure quickPatterns
65
65
66
-
// Due to a potential latching issue when writing data, we use a hard delay for timing with the ESP8266
67
-
#ifdef ESP8266
68
-
quickPatterns.setTickMillis(0);
69
-
#endif
70
-
71
-
#ifndef ESP8266
72
66
quickPatterns.setTickMillis(TICKLENGTH);
73
-
#endif
74
67
75
68
//cylon of 8 pixels that cycles through the rainbow
76
69
quickPatterns.addPattern(new qpBouncingBars(8))
@@ -86,12 +79,9 @@ void setup() {
86
79
87
80
void loop()
88
81
{
89
-
quickPatterns.draw();
90
-
FastLED.show();
91
-
92
-
#ifdef ESP8266
93
-
FastLED.delay(TICKLENGTH);
94
-
#endif
82
+
// Refresh lights only when new frame data available, prevents issues with data timing on fast processors
83
+
if(quickPatterns.draw())
84
+
FastLED.show();
95
85
}
96
86
```
97
87
@@ -130,12 +120,14 @@ void setup() {
130
120
}
131
121
```
132
122
133
-
Finally, in your *loop()* function, call the *draw()* method of the quickPatterns controller and then FastLED.show()
123
+
Finally, in your *loop()* function, call the *draw()* method of the quickPatterns controller and then FastLED.show() when new frame data is available (*draw()* returns true).
124
+
134
125
```
135
126
void loop()
136
127
{
137
-
quickPatterns.draw();
138
-
FastLED.show();
128
+
// Refresh lights only when new frame data available, prevents issues with data timing on fast processors
129
+
if(quickPatterns.draw())
130
+
FastLED.show();
139
131
}
140
132
```
141
133
@@ -765,4 +757,4 @@ Section of lights of length *size* that move back and forth randomly along the l
765
757
---
766
758
Copyright (c) 2020 Chris Brim
767
759
768
-
Tested platforms: ESP8266, ESP32, Teensy 3.2, Arduino Mega
760
+
Tested platforms: ESP8266, ESP32, Teensy 3.2, Teensy 4.0, Arduino Mega
// Due to a potential latching issue when writing data, we use a hard delay for timing with the ESP8266
64
-
#ifdef ESP8266
65
-
quickPatterns.setTickMillis(0);
66
-
#endif
67
-
68
-
#ifndef ESP8266
69
67
quickPatterns.setTickMillis(TICKLENGTH);
70
-
#endif
71
-
72
68
73
69
// ~ Scene 0 - demonstrates running simultaneous patterns at differing speeds, the same bouncing bars pattern with 3 different configurations will weave in and out of sync
74
70
@@ -127,7 +123,7 @@ void setup() {
127
123
CRGB *pulseColors = newCRGB[3];
128
124
pulseColors[0] = CRGB::Blue;
129
125
pulseColors[1] = CRGB::Yellow;
130
-
pulseColors[2] = CRGB::Pink;
126
+
pulseColors[2] = CRGB::DeepPink;
131
127
132
128
// small line of pixels that bounces back and forth
0 commit comments