These are chat archives for esp8266/Arduino

24th
Jun 2017
Stavros Korokithakis
@skorokithakis
Jun 24 2017 02:03
does anyone know of a good/reliable/fast WS2812/neopixel library?
Stavros Korokithakis
@skorokithakis
Jun 24 2017 02:19
@Makuna is there an example in your lib that's just straightforward "set this neopixel to this color?"
Michael Miller
@Makuna
Jun 24 2017 05:56
@skorokithakis BTW, my library has its own gitter channel ;-) NeoPixelTest example is the simplest. It has a lot of comments in it. But here is simple one. NOTE that I am using the Dma Method (reliable on esp8266), if you don't know what this is, read the Wiki.
#include <NeoPixelBus.h>

const uint16_t PixelCount = 4; 

NeoPixelBus<NeoGrbFeature, Neo800KbpsMethod> strip(PixelCount);

void setup()  {
    // this resets all the neopixels to an off state
    strip.Begin();
    strip.Show();
}

void loop()  {
    delay(5000);

    strip.SetPixelColor(0, RgbColor(128,0,0));
    strip.Show();

    delay(5000);

    strip.SetPixelColor(0, RgbColor(0));
    strip.Show();
}
And as far as I know, my library is the only one that is stable on the esp8266, there is a Github Issue in the "other" library that is tracking and comparing all the libraries. I haven't checked if its gotten improved.
Stavros Korokithakis
@skorokithakis
Jun 24 2017 08:44
@Makuna that's great, thank you!
Shelby Merrick
@forkineye
Jun 24 2017 10:19
is there a staging json for 2.4.0-rc1 or should I just pull from github?
Stavros Korokithakis
@skorokithakis
Jun 24 2017 12:41
can someone tell me how to compare a byte array i receive from a socket with a literal string? :/
Martin Ayotte
@martinayotte
Jun 24 2017 12:58
strcmp()
Stavros Korokithakis
@skorokithakis
Jun 24 2017 12:58
@martinayotte thanks, it was complaining about unsigned char to const char and making me want to smash the compiler, but it turns out a cast worked
Martin Ayotte
@martinayotte
Jun 24 2017 12:58
normal
Stavros Korokithakis
@skorokithakis
Jun 24 2017 12:59
yeah, but very frustrating when you don't know what to do :/
is sscanf available in the stdlib?
Stavros Korokithakis
@skorokithakis
Jun 24 2017 14:41

can someone tell me what i'm doing wrong here?:

packet is "Params: 100|1000|70"

unsigned int initial, pixelDuration, height = 0;
sscanf((const char *)packet, "Params: %d|%d|%d", &initial, &pixelDuration, &height);

Printing the params returns:
0
1073656464
0

hmm, looks like packet isn't what i thought, which is very odd
Stavros Korokithakis
@skorokithakis
Jun 24 2017 14:46
ah, never mind, i forgot to add == 0 to strncmp :/