JanBednarik / micropython-ws2812

MicroPython driver for WS2812 RGB LEDs (WS2812B, AdaFruit NeoPixels, ...).
MIT License
188 stars 49 forks source link

wondering #6

Open tarbear123 opened 5 years ago

tarbear123 commented 5 years ago

do i put the total number of led's i'm using like if i use two 24 led ring the total would be 48 and what is the spi_bus=1 used for?

tarbear123 commented 5 years ago

hello?

drewwestrick commented 5 years ago

You are correct, the total number of WS2812 LEDs in the chain goes in led_count. The spi_bus variable is used to define which SPI port / pins the led string is connected to. Many boards like the pyboard have more than one SPI pinned out. In the case of the WS2812 you will only be using the MOSI pin of either SPI 1 or 2.

See the green box in the image below for the location of SPI 1 and 2 on the pyboard 1.0: http://micropython.org/resources/pybv10-pinout.jpg

// Using SPI 2 (pin Y8) with 36 LEDs and an intensity of 15%
ring = WS2812(spi_bus=2, led_count=48, intensity=0.15)