ws2812b or neopixel

Has anyone tried to use a ws2812b rgb strip with raspberry pi?
Hamish

Something like this?
LedStrip

No, the neopixel is 5v and individually adressible.
https://www.adafruit.com/category/168

Neopixel is adafruit brand. The actual LEDs are made by world semi ws2812b
I use them a lot with arduino.
They are quite awesome for lighting effects.
Hamish

Found this tutorial on Adafruit. It claims it might not work on RPi2 but you could give it a try :slight_smile:
https://learn.adafruit.com/neopixels-on-raspberry-pi

Don’t really know how to work it out in Xojo though.

I started to experiment with it but not really successful so far: I can change the colors, but not reliably. The first LED is doing something on its own, and this might have to do with the current set-up missing a capacitor which will be there the next week.
Most resources say you cannot use the Raspi directly because of timing issues, but I found this https://projects.drogon.net/understanding-spi-on-the-raspberry-pi/ where user JohnE says he can use a Neopixel strip with the SPI pins. I’ll send an update once I installed the capacitor.

[quote=260434:@Hamish Steiner]Has anyone tried to use a ws2812b rgb strip with raspberry pi?
Hamish[/quote]
They are not compatible with Raspberry Pi directly. They have a specific frequency requirement, which the Raspberry Pi can’t guarantee. Use a Arduino or so in the middle, and have that control the Neopixel or WS2812b and talk to it with your Raspberry Pi in the way you prefer it.

@Derk: There are projects successfully connecting a Raspi directly to a NeoPixel strip. Most do this by using the SPI pins – see my link above. With a correct setting, although the timing is not 100% up to the specifications, it seems to be close enough to work in many cases.

Others manipulate the pins directly. The problem then is that Raspbian might perform other background tasks that destroy the timing. Björn talks about this on his Einhugur/Raspi blog. Would be worth a try to see if it’s possible to reach a close timing with Xojo disabling background tasks and the like and probably not pausing for a certain time that might get messed up but simply waiting for the end of a wait period in a close loop. Which reminds me: Has anyone measured the accuracy of the DelayMicroseconds and Delay methods in WiringPi for Xojo?

[quote=261861:@Ulrich Bogun]@Derk: There are projects successfully connecting a Raspi directly to a NeoPixel strip. Most do this by using the SPI pins – see my link above. With a correct setting, although the timing is not 100% up to the specifications, it seems to be close enough to work in many cases.

Others manipulate the pins directly. The problem then is that Raspbian might perform other background tasks that destroy the timing. Björn talks about this on his Einhugur/Raspi blog. Would be worth a try to see if it’s possible to reach a close timing with Xojo disabling background tasks and the like and probably not pausing for a certain time that might get messed up but simply waiting for the end of a wait period in a close loop. Which reminds me: Has anyone measured the accuracy of the DelayMicroseconds and Delay methods in WiringPi for Xojo?[/quote]

All i’m saying the chip is not supported. I din’t say it din’t work …:wink:
Your better off using an in-the-middle board or another type of RGB led strip.

There are plenty of types to use;

  • Analog led strip using Pi PWM pins and Transistors
  • Digital PWM strips (transistors build-in)
  • Serial port based (those have a microchip running -like arduino-) led strips
    And potentionally more.

The WS2812 can be driven most easily with an SPI, but the timing is very challenging. Something like 1.2 microseconds per bit. Every time the SPI empties its data register (8 or 16 bits), then the next byte/word must be made available before the last bit shifts out. The idea is to have a continuous stream of bits, and a gap of a few hundred nanoseconds can break that. It could work on an RPi with DMA feeding an SPI. I expect an Rpi driver will be available if it is possible, though I have no idea what is involved in accessing such a driver. I’ve written a WS2812 driver for a Freescale MCU with an interrupt, and also used someone else’s driver for the Arduino.

you can even use an esp8266 to drive your ws2812 directly, and then all your leds are available with wifi from almost anywhere.

and now there is even basic on the esp8266