micropython-ws2812 icon indicating copy to clipboard operation
micropython-ws2812 copied to clipboard

wondering

Open tarbear123 opened this issue 6 years ago • 2 comments

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 avatar Dec 15 '18 04:12 tarbear123

hello?

tarbear123 avatar Dec 17 '18 22:12 tarbear123

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)

drewwestrick avatar Jan 04 '19 21:01 drewwestrick