Writing to an 8-LED WS2812B

Recurrent H/W and software problems
Post Reply
lyizb
Posts: 312
Joined: Fri Feb 12, 2021 8:23 pm
Has thanked: 163 times
Been thanked: 117 times

Writing to an 8-LED WS2812B

Post by lyizb »

I'm writing randomly selected colors (from a palette of the 8 colors for which R, G, and B are either 0 or 255) to randomly selected pins.

If I set up with NEO.SETUP 16,8, the last LED never lights. If I use NEO.SETUP 16,9, all 8 work.

Code: [Local Link Removed for Guests]

dim c(8)=neo.rgb(0,0,0),neo.rgb(0,0,255),neo.rgb(0,255,0),neo.rgb(0,255,255),neo.rgb(255,0,0), neo.rgb(255,0,255),neo.rgb(255,255,0),neo.rgb(255,255,255)
NEO.SETUP 16,9
i=0
do
  p=rnd(8) ' select a pin between 0 and 7
  clr=rnd(8) ' select one of 8 colors 
  wlog p, clr, c(clr)
  neo.pixel p,c(clr)
  pause 1000
loop
Post Reply