This hack takes advantage of that faster speed to "synthesize" the NeoPixel data
signal on the SPI's MOSI pin. In its most simple form, the hack turns every bit of
NeoPixel data into a specific byte in the SPI data. There only two bytes that matter -
one that represents a NeoPixel 0 bit, and one that represents a NeoPixel 1 bit.
Once the desired NeoPixel data has been translated into SPI data, it is simply clocked
out on the SPI bus. The SPI bus frequency is set such that the data comes out at the
expected NeoPixel timing. Then, by wiring the SPI MOSI pin to the NeoPixel data in
pin, you can drive NeoPixels using the SPI bus. From the NeoPixel's point of view, it
just sees the specific data signal it expects and you get happy blinky NeoPixels.
SPI Support in CircuitPython NeoPixel Library
All this work has been done for you via a new NeoPixel_SPI class that can be found in
the CircuitPython NeoPixel SPI library(https://adafru.it/NHd). When driving NeoPixels
via a SPI port, you simply use this class. After the initial setup, you can then use the
NeoPixels as normal.
Let's see some examples.
FT232H Example
Using the SPI port option of an FT232H, we can drive NeoPixels from any PC with a
USB port. See here for details about getting the FT232H installed and setup for your
specific operating system:
CircuitPython FT232H Guide
https://adafru.it/Gbs
And of course, also install the NeoPixel library:
sudo pip3 install adafruit-circuitpython-neopixel-spi
FT232H Wiring
The wiring is pretty simple.
FT232H 5V to NeoPixel VIN
FT232H GND to NeoPixel GND
•
•
©Adafruit Industries Page 4 of 6