Code Monkey home page Code Monkey logo

makuna / neopixelbus Goto Github PK

View Code? Open in Web Editor NEW
1.2K 58.0 256.0 1.27 MB

An Arduino NeoPixel support library supporting a large variety of individually addressable LEDs. Please refer to the Wiki for more details. Please use the GitHub Discussions to ask questions as the GitHub Issues feature is used for bug tracking.

License: GNU Lesser General Public License v3.0

C++ 89.95% C 10.05%
neopixels arduino led-controlling led-strips rgb-led ws2812 ws2812b sk6812 ws2813 esp8266-arduino

neopixelbus's Introduction

NeoPixelBus

Donate

Arduino NeoPixel library

A library to control one wire protocol RGB, RGBW, and RGBWW leds like APA106, SK6812, WS2811, WS2812 and WS2813 that are commonly refered to as NeoPixels and two wire protocol RGB like Lpd8806, APA102 and SK9822 commonly refered to as DotStars. Supports most Arduino platforms.

For quick questions and support:

For bugs, make sure there isn't an active issue and then create one.

Documentation

See Wiki

Installing This Library (preferred, you just want to use it)

Open the Library Manager and search for "NeoPixelBus by Makuna" and install

Installing This Library From GitHub (advanced, you want to contribute)

Create a directory in your Arduino\Library folder named "NeoPixelBus" Clone (Git) this project into that folder.
It should now show up in the import list when you restart Arduino IDE.

neopixelbus's People

Contributors

agners avatar aircoookie avatar alltheblinkythings avatar atanisoft avatar berrak avatar drzony avatar embedded-creations avatar feindsender avatar gitter-badger avatar h3ndrik avatar ivankravets avatar juerd avatar makuna avatar marcmerlin avatar mdoersam avatar nick-diel avatar owendelong avatar pantastisch avatar peragwin avatar pkendall64 avatar programminghoch10 avatar reaper7 avatar robert-github-com avatar s-hadinger avatar schlammbad avatar shlomozippel avatar szekelyisz avatar vasil-pahomov avatar willmmiles avatar xonestonex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neopixelbus's Issues

Change pixel number at run time

Would be useful to be able to redefine the number of pixels, and the output pin.

The esp can be configured by web interface, so modules can be deployed then configured.

I tried adjusting the count by re-issuing the NeoPixelBus strip = NeoPixelBus(pixelCount, 8); (in the adafruit lib, not yours) but every time the loop circles it gets reset.

HsbColor with Hue set to 1.0f

If I use HsbColor(1.0f,1.0f,1.0f) the pixel seems not do be correct Red. There is a big jump between Hue 0.999 and 1.0f. Just checked the Hsb to Rgb conversation and there is no case to handle hue values of 1.0f. I am using Esp8266 UART.

Pixel length limit?

Hi Michael,

I was wondering if there was a pixel length limit? What's the longest length you'd been successful at driving with your NeoPixelBus sketch?

I'm hoping to drive two 300 pixel strips (joined together with power injected at multiple points).

An item in the FAQ with yours and other peoples success stories might be a good idea? Once my Esp8266's arrive I'll submit a PR with my trials.

Cheers,

Steve

No UartDriven Stable with ESP8266 + Wifi on gpio0

@Makuna ,

I'm using this lib on all my ESP8266 boards (thanks for it, it rocks!).
I just noticed that you recommend using UartDriven version at 160MHz but on my boards I just have 1 LED for visual information. I'm running at 80MHz without any problem on GPIO0 (so not UART driven) with SDK 1.3.0 (in fact arduino ESP8266 branch) and of course Wifi activated.

Do you have any more information of the crash with Wifi problem because I don't see it ? May be it's related with number of LED driven ? Do you think it's safe to drive 1 LED without Uartdriven method ?

thanks for any explanation.

Uart branch flickers and flahes with 150 neopixels

Doing a simple animation with 150 neopixels lighting up one neopixel after the other (code below), part of the strand flashes randomly. (see https://www.youtube.com/watch?v=BjJZworuFgM)
I've got the Huzzah ESP8266 set up at 160Mhz in the Arduino IDE with the Uart branch of NeoPixelBus and the Esp Arduino library version 2.0.0. (Arduino 1.6.5)

#include <NeoPixelBus.h>

#define pixelCount 150 // this example assumes 4 pixels, making it smaller will cause a failure
#define pixelPin 2  // make sure to set this to the correct pin

#define colorSaturation 128

NeoPixelBus strip = NeoPixelBus(pixelCount, pixelPin);

RgbColor red = RgbColor(colorSaturation, 0, 0);
RgbColor green = RgbColor(0, colorSaturation, 0);
RgbColor blue = RgbColor(0, 0, colorSaturation);
RgbColor white = RgbColor(colorSaturation);
RgbColor black = RgbColor(0);

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

void wipe(RgbColor col)
{
    for (uint8_t pixel = 0; pixel < pixelCount; pixel++)
    {
      strip.SetPixelColor(pixel, col);
      strip.Show();
      delay(31); // 31ms ~= 30hz?
    }
}

void loop()
{
    wipe(red);
    wipe(black);

    wipe(green);
    wipe(black);

    wipe(blue);
    wipe(black);

    wipe(white);
    wipe(black);
}

ESP8266 different working mode confirmations and features

I'm designing a new PCB board and referring to my old issue #33, I have two questions :

  • does the bit bang mode still has problem with WiFi enabled or is it solved with new SDK (1.5.1) ?
  • I think I know the answer, but just in case, using UART Driven or DMA mode remove me the ability to use UART as normal serial for other tasks, right ?

Thanks for any help

NeoGrbFeature and Neo800KbpsMethod

Hi, I can't make it work.....
Always getting an Error
"Type 'NeoGrbFeature' could not be resolved"
and
"Type 'Neo800KbpsMethod' could not be resolved".

on line
NeoPixelBus<NeoGrbFeature,Neo800KbpsMethod> strip(pixelCount, pixelPin);

And yes, I can't see them defined anywhere.
It seems to be something is missing from the sources ??
I am on platform.io, for platform espressif (esp12).

void Lighten(uint8_t delta) loses colour information

The code below moves the brightness of an NeoPixel that is set to Blue up and down.

Darken is fine. However, when I use the Lighten command I can see the other Leds in the NeoPixel turn on and I have white light.

However, when the NeoPixel darkens again the low level light is blue.

What is Lighten actually doing to the NeoPixel?

Uart example code does not work with ESP8266 v12

The example code, NeoPixelTest from the Uart branch, does not work with an ESP8266 v12 coupled with an AdaFruit NeoPixel ring.

I get no output from the LEDs at all.
Using the Master branch works fine with NeoPixelTest
I removed the HslColor code when doing both tests.

I can't get the UART branch to light an LED at all.

Unstable behavior with 50+ pixels

I have a NodeMCU V1.0 module
I can get the UART based library to work using pin 4(the only pin that works)
However it only drives about 40-50 pixels. anything greater and they start flickering.
Things i have tested for:
-I ran the strip using both 5v and 3.3v but the same issue occurs on both voltages
-I'm getting a nice steady 3.3v signal from Pin 4, so when i have less than 50 pixels its all good
-im running the strip on very low max values, so that the saturation level is as an example (10,10,10)

License

what is the license on your code?

allowing async operation / framebuffer mode

hi makuna,

i see the code has developed very well. good work.
but what i am missing right now is the possibility to use the valuable CPU time for useful stuff.

i understand that there is some compatibility issue because it doesn't block just like the old bitbang code did.
but adding code to make it behave more like a framebuffer device would make it more flexible.
this will deliver you a standalone engine that just feeds RAM content to you beloved WS2812 without any CPU cost and
the CPU will do it's stuff, updating the RAM from time to time and handle network IO etc.

proposal:

public void NeoEsp8266DmaMethodBase:StartDmaAsync()
configures the I2S buffer chain to: data->latch->data ...

public void NeoEsp8266DmaMethodBase:WaitSync()
waits (polling) for EOF that is only set when reaching the latch-buffer (it behaves like a vblank period, allowing code to fill buffers)

BR,
g3gg0

Wrong colors with ESP-12-E module

I am using this library with an ESP-12-E module, as part of a NodeMCU-1.0 board.
Running the stock example that is meant to illuminate 4 pixels, I am getting wrong color output on the pixels, where I get: blue, red, black, white, green on the first 5 pixels.

The setup is driving two chained strips of 144 pixel/m strips, brought from Adafruit.
The strip is declared to operate with pin D2 (where 'D2' is used in the code). Same result when driving with D1.

Fast allocation of pixels

I'm currently reading pixel colors from a buffer, or buffer array.

Is there a really fast way to shift the data out to the array that show() uses. Right now I for loop through, generate an rgbcolor object and setpixelcolor but I figure there is a more efficient way as they are just strings of bytes?

(Thanks for all the help btw!)

Working with the RGB object

I'm trying to get certain bits of the adafruit effects to work with your lib, and I'm struggling.
The adafruit guys have wheel function that allows generation of smooth colours, but it usually returns a 32bit number for the colours. your lib works with r,g,b object.

now you have this in you rgb.cpp which suggests to me that you can return an rgb object with 3 colours from a function... however...

'''''
RgbColor RgbColor::LinearBlend(RgbColor left, RgbColor right, uint8_t progress)
{
return RgbColor( left.R + ((right.R - left.R) * progress / 255),
left.G + ((right.G - left.G) * progress / 255),
left.B + ((right.B - left.B) * progress / 255));
}
''''''

This does not work for me.

RgbColor Wheelnew (byte WheelPos) {
  WheelPos = 255 - WheelPos;
  if(WheelPos < 85) {
   return  RgbColor(255 - WheelPos * 3, 0, WheelPos * 3);
  } else if(WheelPos < 170) {
   WheelPos -= 85;    
   return RgbColor(0, WheelPos * 3, 255 - WheelPos * 3);
  } else {
   WheelPos -= 170;
   return  RgbColor(WheelPos * 3, 255 - WheelPos * 3, 0);
  }
}  

I get
Melvano-Core.ino:36:1: error: 'RgbColor' does not name a type
Error compiling.

Setting colors during setup causes white flashes

from @sticilface

example app

#include <NeoPixelBus.h> // NeoPixelAnimator branch

#define pixelCount 7 // Strip has 30 NeoPixels
#define pixelPin 2 // Strip is attached to GPIO2 on ESP-01

NeoPixelBus strip = NeoPixelBus(pixelCount, pixelPin);

void setup() {

    strip.Begin();
    strip.Show();

   // delay(100);

for (int i = 0; i < 5; i++) {
  strip.ClearTo(RgbColor(0,0,0));
  strip.Show();
  delay(100);
  strip.ClearTo(RgbColor(0,0,255));
  strip.Show();
  delay(100); 
}


}

void loop() {

  delay(10);
  strip.ClearTo(RgbColor(0,0,0));
  strip.Show();
  delay(500);
  strip.ClearTo(RgbColor(0,255,0));
  strip.Show();
  delay(500); 
}

how to declare strip extern to be usuable in all files

Hi there,

I've got lot's of .cpp files in my project, each with one .cpp and one .h file. Before V2 I was declaring rgb let strip as follow in my main.ino file

  ESP8266WebServer server(80);
  NeoPixelBus rgb_led = NeoPixelBus(1, RGB_LED_PIN, NEO_RGB | NEO_KHZ800);

And in main.h as follow

  extern ESP8266WebServer server;
  extern NeoPixelBus<NeoRgbFeature, NeoEsp8266BitBang800KbpsMethod> rgb_led();
#endif

All was working fine but with this new version, I'm sorry I'm not a cpp fan and I don't know how to do this, I tried doing the same but looks like extern template works different

  ESP8266WebServer server(80);
  NeoPixelBus<NeoRgbFeature, NeoEsp8266BitBang800KbpsMethod> rgb_led(1, RGB_LED_PIN);

And in main.h as follow

  extern ESP8266WebServer server;
  extern NeoPixelBus<NeoRgbFeature, NeoEsp8266BitBang800KbpsMethod> rgb_led();

but it fire a

error: 'NeoPixelBus<NeoRgbFeature, NeoEsp8266BitBangMethodBase<NeoEsp8266BitBangSpeed800Kbps> > rgb_led' redeclared as different kind of symbol

   NeoPixelBus<NeoRgbFeature, NeoEsp8266BitBang800KbpsMethod> rgb_led(1, RGB_LED_PIN);

any idea how to achieve this ?

Thanks

Problems with gamma, does not compile.

Moving from 2.03 to 2.04 no longer compiles for me with this error


libraries/Melvanimate/EffectManager.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): multiple definition of `NeoGammaTableMethod::_table'
sketch/Melvanimate-example.ino.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): first defined here
libraries/Melvanimate/Melvanimate.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): multiple definition of `NeoGammaTableMethod::_table'
sketch/Melvanimate-example.ino.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): first defined here
libraries/Melvanimate/MelvanimateMQTT.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): multiple definition of `NeoGammaTableMethod::_table'
sketch/Melvanimate-example.ino.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): first defined here
libraries/Melvanimate/PropertyManager.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): multiple definition of `NeoGammaTableMethod::_table'
sketch/Melvanimate-example.ino.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): first defined here
libraries/Melvanimate/helperfunc.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): multiple definition of `NeoGammaTableMethod::_table'
sketch/Melvanimate-example.ino.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): first defined here
libraries/Melvanimate/effects/AdalightEffect.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): multiple definition of `NeoGammaTableMethod::_table'
sketch/Melvanimate-example.ino.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): first defined here
libraries/Melvanimate/effects/Blobs.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): multiple definition of `NeoGammaTableMethod::_table'
sketch/Melvanimate-example.ino.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): first defined here
libraries/Melvanimate/effects/DMXEffect.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): multiple definition of `NeoGammaTableMethod::_table'
sketch/Melvanimate-example.ino.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): first defined here
libraries/Melvanimate/effects/RainbowChase.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): multiple definition of `NeoGammaTableMethod::_table'
sketch/Melvanimate-example.ino.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): first defined here
libraries/Melvanimate/effects/Snakes.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): multiple definition of `NeoGammaTableMethod::_table'
sketch/Melvanimate-example.ino.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): first defined here
libraries/Melvanimate/effects/UDPEffect.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): multiple definition of `NeoGammaTableMethod::_table'
sketch/Melvanimate-example.ino.cpp.o:(.rodata._ZN19NeoGammaTableMethod6_tableE+0x0): first defined here
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Generic ESP8266 Module.

I'm not sure where to look to figure this one out unfortunately... been trying. The example still compile... but my melvaniamte does not...

Enhancement: grant its own library to color handling classes

You have write an excelent color handling class collection, like no other in Arduino world. They deserve its own library so other projects can reuse it.

Also, NeoPixelAnimator doesn't seem to depend on NeoPixelBus and can be used with other addressable led strips, so maybe could also get its own library too.

Animations

I was wondering if you could provide a bit more info on the way animations work. I can't seem to satisfy my understanding just looking at the code.. It uses timers when the update animations is called to work out if it is time to update the string... The code below works fine....

void SetRGBcolour (RgbColor value) {
   int amounttodarken = 255 - CurrentBrightness;
   value.Darken(amounttodarken);
    for (uint8_t pixel = 0; pixel < pixelCount; pixel++) {
        strip.LinearFadePixelColor(1000, pixel, value);
    }
}

but if i increase the time, to 5000 (fade over 5 seconds, the ESP just reboots...)

Dimming

(Forgive me as I have a few issues)...

I can't seem to get the dimming to work reliably... I have a slider on a webpage, 0-255.. which returns a string...

void WS2812_dim_string (String Value)
{

  RgbColor prevColor;

      int dim = Value.toInt();
      if (dim > 255) dim = 255;
      if (dim < 0) dim = 0;

      int DiffDim = CurrentBrightness - dim;
      CurrentBrightness  = dim; 

      if (DiffDim > 0) {  
        Serial.println("Brightness Darken by: " + String(DiffDim));

        for (int i = 0; i < pixelCount; i++) {
          prevColor = strip.GetPixelColor(i);
          prevColor.Darken(DiffDim);
          strip.SetPixelColor(i,prevColor);
        }
      } else if (DiffDim < 0) { 
        DiffDim = DiffDim * -1;
        Serial.println("Brightness Lighten by: " + String(DiffDim));
          for (int i = 0; i < pixelCount; i++) {
          prevColor = strip.GetPixelColor(i);
          prevColor.Lighten(DiffDim);
          strip.SetPixelColor(i,prevColor);       
        }
      } 
          strip.Show();
}

Making it darker works just fine, but going the other way results in far too much white most of the time. Got any ideas? If you darken by a negative does that make it lighter? should it...?

RgbColor object

Is there a way to work with the individual colours in an rub object?

you can set it test = RgbColor(r,g,b) but can you go back from it to get the r,g,b components from test?

You lib is working very well by the way, the new level interrupts make is smooth as butter. I've driven 260 LEDs, without a flicker...

Add NeoPixelBuff constructor without parameters.

I try to change pixel number after read configuration from outside.
My code:
NeoPixelBus * strip;
main(){
.......
NeoPixelBus b = NeoPixelBus(configuration.lednum, pixelPin);
strip = &b;

.....
}
I receive a bad Exception(29) reset trying to use
in a function
strip->ClearTo(c);
strip->Show();
delay(1);
strip->Pause();

Examples only work using GPIO13

For some reason, I can only get the examples to control the WS2812 LEDs when connected to GPIO13 on my ESP-12 (4 Mbyte model).

Any other pin and while it programs the ESP module successfully, the LEDs do nothing.

If I recall correctly, GPIO13 is the SPI pin on the ESP. Does the NeoPixelBus library handle GPIO13 differently than other pins?

Lights not being set correctly using uart branch

Hey all, great library. I am powering about 200 neopixels off a nodemcu 1.0. I managed to get the uart branch to work by hooking up the neopixels to GPIO0 and a level shifter, but it doesn't appear very reliable. I set the code to flash the entire strip on and off with green, but I keep getting flashes of other colors appearing, which makes me think that the timing is not working properly.

Has anyone else had this problem, is there anything else I can try? I am recieving OSC signals on the esp8266 and using it to sequence our lighting rig, but at this stage it looks like we're going to have to go back to using a raspberry pi.

using NeoPixelBus for APA102 LED strip

hi @Makuna , is it possible to use you lib on ESP module for the LED with clock and data such as APA102? I've tried to use FastLED lib but no success with APA102, whereas had good result on APA104

Dynamic change of NeoPixel Type ?

Following dynamic strip example FAQ here https://github.com/Makuna/NeoPixelBus/wiki/FAQ-%233, is there also a way of changing NeoPixel Type avoiding x pointer declaration ?
for example change from NeoGrbFeature to NeoRgbFeature

IE something like that ?

  // delete the previous dynamically created strip
  if (rgb_led != NULL) 
     delete rgb_led; 

  if (config.led_type == RGB_TYPE_GRB ) {
    rgb_led = new NeoPixelBus<NeoGrbFeature, Neo800KbpsMethod>(config.led_num, config.led_gpio); 
  } else if (config.led_type == RGB_TYPE_RGBW ) {
    rgb_led = new NeoPixelBus<NeoRgbwFeature, Neo800KbpsMethod>(config.led_num, config.led_gpio); 
  } else if (config.led_type == RGB_TYPE_GRBW ) {
    rgb_led = new NeoPixelBus<NeoGrbwFeature, Neo800KbpsMethod>(config.led_num, config.led_gpio); 
  } else {
    rgb_led = new NeoPixelBus<NeoRgbFeature, Neo800KbpsMethod>(config.led_num, config.led_gpio); 
  }

  rgb_led->Begin();

Thank for any help

esp12 crashes in accespoint if strip.show() called.

Hi there!
I am creating code for my esp12 using arduino,
and your library to address ws2812 ledstrips.
it is connected to pin 14.

when i comment strip.show() my html shows and the esp12 doesn't crash.
but if i uncomment strip.show() my esp12 crashes in accespoint mode when i try and reach my html pages.

code:
https://github.com/Duality4Y/Sketchbook/tree/master/sketchbook/webserver-esp

in ws2812.cpp you can see that the update function calles the strip.show();
and in stripcontrol.cpp in hanldeStrips(),
you'll see i Uncommented the update function.

so any ideas?

by crashing I meen it triggers the WDT.

Minor warning to correct.

I have some wanings in my eclipse IDE , i don't know if they are reported in Arduino IDE.

Description Resource Path Location Type
Member 'H' was not initialized in this constructor HslColor.h /esp8266_rgbwebstrip/Libraries/NeoPixelBus/src line 56 Code Analysis Problem
Member 'L' was not initialized in this constructor HslColor.h /esp8266_rgbwebstrip/Libraries/NeoPixelBus/src line 56 Code Analysis Problem
Member 'S' was not initialized in this constructor HslColor.h /esp8266_rgbwebstrip/Libraries/NeoPixelBus/src line 56 Code Analysis Problem
Suggested parenthesis around expression 'PIN_FUNC_SELECT(PERIPHS_IO_MUX_U0RXD_U, FUNC_I2SO_DATA)' NeoPixelBus.cpp /esp8266_rgbwebstrip/Libraries/NeoPixelBus/src line 191 Code Analysis Problem
Member 'B' was not initialized in this constructor RgbColor.h /esp8266_rgbwebstrip/Libraries/NeoPixelBus/src line 62 Code Analysis Problem
Member 'G' was not initialized in this constructor RgbColor.h /esp8266_rgbwebstrip/Libraries/NeoPixelBus/src line 62 Code Analysis Problem
Member 'R' was not initialized in this constructor RgbColor.h /esp8266_rgbwebstrip/Libraries/NeoPixelBus/src line 62 Code Analysis Problem

NeoEsp8266Dma* method is not working (Wemos D1 Mini, and 12e confirmed)

Hi, there seems to be one or two issues when running on the D1 Mini.

Firstly, the data pin seems to be fixed on Arduino pin 3 which is the RXD pin on the D1 Mini and causes the whole string to go to max output when restarting.

Secondly most of the examples don't work. The Cylon example completes a single cycle, the others don't do anything though the ones that have serial output clearly show they are cycling.

This is a shame as I like the capabilities of the library.

I'm working with an 8 LED WS2812 5050 based neopixel. It works fine with the Adafruit library.

Only bitbang works on my esp8266

I tried all methods to get my stripe working. But only the bitbang-method works (so this shows me that I am using the right gpio-pin). With DMA, nothing happens. I am using an esp12e and gpio pin 4.
What am I doing wrong?

Strange behaviour with Animation branch on NodeMCU arduino ide

When using the animation branch it seems like the timing is off - the lights are glitchy and mustly white. The other branch looks more tight. I have used it where it was ok. But after switching to the staging version of arduino/esp ide library it became glitchy.

http://arduino.esp8266.com/staging/package_esp8266com_index.json

I am not sure what det difference is - just giving you a heads up. FYI: I had to chose nodemcu 0.9 board to be able to upload. Before i just used the generic esp board from arduino.

This is the branch i used to use without your library glitching.

http://arduino.esp8266.com/package_esp8266com_index.json

can't compile in ardu ide

hey makuna, thanks for the work on neopixelbus.
trying to use it for the esp but can't compile in the ardu ide (1.6.4)
i get a bunch of "not defined in this scope" (below)

i followed your instructions, also tried putting the lib in /libraries (as recommended in new ide version) and also did an official lib install via zip import (also in 1.6.4) and reastarted the ide with each try. to no avail. thanks for your support!

C:\xxx\libraries\NeoPixelBus\NeoPixelBus.cpp: In function 'void send_pixels_800(uint8_t_, uint8_t_, uint8_t)':
C:\xxx\libraries\NeoPixelBus\NeoPixelBus.cpp:88:41: error: '_BV' was not declared in this scope
const uint32_t pinRegister = _BV(pin);
^
C:\xxx\libraries\NeoPixelBus\NeoPixelBus.cpp:93:23: error: 'class EspClass' has no member named 'getCycleCount'
cyclesStart = ESP.getCycleCount() + CYCLES_800;
^
C:\xxx\libraries\NeoPixelBus\NeoPixelBus.cpp:109:35: error: 'class EspClass' has no member named 'getCycleCount'

esp8266 example

The readme mentions esp8266 support - do you have any code examples? I'm trying to get it working with the esp8266 Arduino library and a couple of NeoPixels attached to GPIO2. My sketch looks like this:

#include <NeoPixelBus.h>

#define PIN 4
#define PIXELS 2

NeoPixelBus strip = NeoPixelBus(PIXELS, PIN);

void setup(void) {
  Serial.begin(115200);

  strip.Begin();

  strip.SetPixelColor(0, RgbColor(255, 0, 0));
  strip.SetPixelColor(1, RgbColor(255, 0, 0));

  strip.Show();
}

void loop(void) {
}

I'd expect them to both turn red but instead they just show random colours.

Error compiling

Below is a printout from the IDE. I would try fixing, but I'm lost by your syntax :)

/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp: In lambda function:
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp:723:18: error: expected '{' before string constant
         [lo]     "r" (lo));
                  ^
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp: In member function 'void NeoPixelBus::Show()':
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp:723:18: error: expected ';' before string constant
Error compiling.

I was originally going to try this on the esp8266, but I get an even longer list of compile errors when selecting that board...

/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp: In function 'void send_pixels_800(uint8_t*, uint8_t*, uint8_t)':
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp:88:41: error: '_BV' was not declared in this scope
     const uint32_t pinRegister = _BV(pin);
                                         ^
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp:94:20: error: 'GPIO_OUT_W1TC_ADDRESS' was not declared in this scope
     GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, pinRegister);
                    ^
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp:94:54: error: 'GPIO_REG_WRITE' was not declared in this scope
     GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, pinRegister);
                                                      ^
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp:96:23: error: 'class EspClass' has no member named 'getCycleCount'
     cyclesStart = ESP.getCycleCount() + CYCLES_800;
                       ^
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp:112:35: error: 'class EspClass' has no member named 'getCycleCount'
                 cyclesStart = ESP.getCycleCount();
                                   ^
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp:117:28: error: 'GPIO_OUT_W1TS_ADDRESS' was not declared in this scope
             GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, pinRegister);
                            ^
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp:122:29: error: 'class EspClass' has no member named 'getCycleCount'
                 while ((ESP.getCycleCount() - cyclesStart) < CYCLES_800_T1H);
                             ^
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp:126:29: error: 'class EspClass' has no member named 'getCycleCount'
                 while ((ESP.getCycleCount() - cyclesStart) < CYCLES_800_T0H);
                             ^
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp: In function 'void send_pixels_400(uint8_t*, uint8_t*, uint8_t)':
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp:141:41: error: '_BV' was not declared in this scope
     const uint32_t pinRegister = _BV(pin);
                                         ^
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp:147:20: error: 'GPIO_OUT_W1TC_ADDRESS' was not declared in this scope
     GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, pinRegister);
                    ^
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp:147:54: error: 'GPIO_REG_WRITE' was not declared in this scope
     GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, pinRegister);
                                                      ^
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp:149:23: error: 'class EspClass' has no member named 'getCycleCount'
     cyclesStart = ESP.getCycleCount() + CYCLES_400;
                       ^
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp:162:35: error: 'class EspClass' has no member named 'getCycleCount'
                 cyclesStart = ESP.getCycleCount();
                                   ^
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp:166:28: error: 'GPIO_OUT_W1TS_ADDRESS' was not declared in this scope
             GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, pinRegister);
                            ^
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp:171:29: error: 'class EspClass' has no member named 'getCycleCount'
                 while ((ESP.getCycleCount() - cyclesStart) < CYCLES_400_T1H);
                             ^
/Users/andy/Documents/Arduino/libraries/NeoPixelBus/NeoPixelBus.cpp:175:29: error: 'class EspClass' has no member named 'getCycleCount'
                 while ((ESP.getCycleCount() - cyclesStart) < CYCLES_400_T0H);
                             ^
Error compiling.

ESP8266 drives LEDs slow

Great library! Thank you!
Running your examples on ESP-01 board with Arduino 1.6.5 on the Linux. Timing on the oscilloscope looks way slower (10-20 times) then NeoPixels requires. Not sign of Light. Any suggestions?

Flicking green first pixel...

I know i've posted this / asked you before... but I'm out of ideas...

The ws2812, work perfectly. I've driven over 300 of them using an ESP-01.... With multiple strips (144, 60, several 8 LEDs on strips..) I get a flicking first green pixel.

I am now using 74HCT245Ns, which are meant to be the best for logic upping 3.3V to 5V, and again the strips work perfectly. Just not that first pixel... it still flicks green.... its always green... I have a 100Ohm resister in series, and a 103 cap to ground on data.... What else do you think I should try... ? scope time?

PS.. I've ported Adalight (well had to start from the ground up, took a while) and got it to work with hyperion on rpi (rasplex) in a non-i/o blocking way. The web server, MQTT and everything still works. You can choose between multiple effects, UDP streaming, or Adalight (ambilight for the TV) ;)
only other issue is that UDP streaming eventually causes the ESP to hang!

Fade pixel out of bounds causes intermittent crash

if you use setpixelcolor and incorrectly assign a pixel above how many you have... it is fine.. (or seems to be) if you use LinearFadePixelColor and accidentally do that... it becomes very unstable, crashing intermittently....

i'm assuming you get a buffer overrun... and it crashes... but crucially.. only sometimes.. (i guess it depends on adjacent memory..

Compiling Error

include NeoPixelBus.h

include RgbColor.h

bool on = false;
void setup() {
Serial.begin(9600);
pinMode(2, OUTPUT);
}
void loop() {
Serial.write("penis");
}

void blink() {
digitalWrite(2, on);
if (on) {
on = false;
} else {
on = true;
}
delay(200);
}

void led(){
}

//output

c:/users/squall/desktop/arduino-1.6.1/hardware/tools/esp8266/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-mallocr.o):(.literal+0x2c): undefined reference to _sbrk_r' c:/users/squall/desktop/arduino-1.6.1/hardware/tools/esp8266/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-mallocr.o): In functionmalloc_extend_top':
d:\ivan\projects\arduinoesp\toolchain\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\stdlib/../../../../../newlib/libc/stdlib/mallocr.c:2165: undefined reference to _sbrk_r' d:\ivan\projects\arduinoesp\toolchain\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\stdlib/../../../../../newlib/libc/stdlib/mallocr.c:2202: undefined reference to_sbrk_r'
c:/users/squall/desktop/arduino-1.6.1/hardware/tools/esp8266/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-freer.o): In function _malloc_trim_r': d:\ivan\projects\arduinoesp\toolchain\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\stdlib/../../../../../newlib/libc/stdlib/mallocr.c:3325: undefined reference to_sbrk_r'
d:\ivan\projects\arduinoesp\toolchain\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\stdlib/../../../../../newlib/libc/stdlib/mallocr.c:3332: undefined reference to _sbrk_r' c:/users/squall/desktop/arduino-1.6.1/hardware/tools/esp8266/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib\libc.a(lib_a-freer.o):d:\ivan\projects\arduinoesp\toolchain\dl\esp-newlib\build\xtensa-lx106-elf\newlib\libc\stdlib/../../../../../newlib/libc/stdlib/mallocr.c:3340: more undefined references to_sbrk_r' follow
collect2.exe: error: ld returned 1 exit status

DMA driven not working

Hi i tried on 2 esp12e bords DMA driven library.
All leds are getting white... right amount of them but all white

Master works ok - when hooking up osciloscope i can see all 0 and 1
But when do the same for for DMA driven i got only 11111111. and that causes all led to be white.
Frequency is ok. Also amount of data is ok. only data itself is wrong

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.