2016. okt 25.

Controlling Neopixel on Raspberry Pi 2 and Pi 3

írta: Takács Ferenc bp.
Controlling Neopixel on Raspberry Pi 2 and Pi 3

Because the all versions of rpi-ws281x library was wrong (make only random flashing) on Pi 3, make me the own program to contol the neopixel RGB LED tape.

My version not use DMA, and PWM chanels, only direct digital IO lines with dummy cycle timing. This entails a limitation of LEDs, because any interrupt mess up the timing. This case repetated the control sequence, and rare this case, when few leds.

I use the wiringPi library, but I made some adjustments for accurate timing. If you want to try my program on your device, you must first install this library. Thereafter must copy my files to appropriate directories.

My files:
wiringPi.h       for change original file in directory wiringPi,
wiringPi.c       for change original file in directory wiringPi,
neopixel.cpp  my program file copy to directory examples,
gamma.h       the include file copy to directory examples,
Makefile         for change original file in directory examples.

You must (re)build the library with "./build" command in library root, and make my program with "make neopixel" command in directory examples.

Hardware:
The LED tape connected to Raspberry Pi trough three pins.

  • GND connected direct to header pin 6.
  • 5V connected through an diode to header pin 2. The diode reduces power with 0.7 V and increases the 3.3V high logical level to valid range (0.7 * VDD).
  • Din connected direct to header pin 12.

Good job! 

 

Szólj hozzá