Replies: 1 comment 1 reply
-
I would change two lines,
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Been playing with an ESP8266 NodeMcu for a few months now, using a 16x16 5050 LED grid. The thing would WDT reboot randomly using the adafruit library when calling strip.show(). As a bonus it would display really freaky stuff using tone when calling strip.show(), you could see the sounds. I was using pin D6 if anyone wants to try it out. :P
Anyway... this solved both those problems! It hasn't crashed in about 12h so far and I can play tones without LED sparkles or pausing it to avoid sparkles. Took me a bit to figure out how to convert over some items I had.. Here is a sketch that might help some trying to convert from adafruit. Plug LED input into RX aka GPIO3 , this prevents sending serial commands to the ESP8266, but you can still print serial for debugging. (If you need to send commands, just use the webserver)
`
#include <NeoPixelBusLg.h>
NeoPixelBusLg<NeoGrbFeature, NeoEsp8266DmaWs2812xMethod> strip(256, GPIO3);
//store an array of colours:
int a[5][3] = { {255,0,0},{255,128,0},{255,255,0},{0,255,0},{0, 0, 255} };
int ii=0; // start at LED 0
void setup() {
Serial.begin(115200); //has to be called before strip.Begin()
while (!Serial);
strip.Begin();
strip.SetLuminance(100);
strip.Show();
}
void loop(){
for (int i=0;i<5;i++) {
strip.SetPixelColor( ii, { a[i][0],a[i][1],a[i][2] } );
}
ii++;
if (ii>255) { ii=0; }
strip.Show();
delay(100);
}
// I haven't tested this exact code, I just made it up for this article, but it SHOULD work.
`
Beta Was this translation helpful? Give feedback.
All reactions