microsoft / pxt-neopixel

A Neo-Pixel package for pxt-microbit
https://makecode.microbit.org/pkg/microsoft/pxt-neopixel
MIT License
58 stars 141 forks source link

In RGB+W Mode, showColour() lights an extra LED, and clear() ignores it. #28

Open nbogie opened 6 years ago

nbogie commented 6 years ago

Simplest repeatable failing test: https://makecode.microbit.org/_YmYf9i6AzAxA

Note: This behaviour isn't visible in the simulator (perhaps because the simulator is only showing the number of LEDs configured by the create() call). In the real world this would only be noticed if neopixel.create() was called with a lower number of pixels than actually contained on the physical strip.

let lightStrip: neopixel.Strip = null
lightStrip = neopixel.create(DigitalPin.P0, 3, NeoPixelMode.RGBW)
basic.pause(1000)
lightStrip.showColor(neopixel.colors(NeoPixelColors.Red))
basic.pause(1000)
lightStrip.clear()
lightStrip.show()

Expected Behaviour (on real strip): Should see pixels 0,1,2 all red, only

Actual Behaviour (on real strip): As expected except pixel 3 is lit green and stays on after the clear()

rgbw extra unclearable pixel issue

Notes: I've tested with various configured lengths, whether 3, 15, or 60 pixels, the library call will always light this extra (last + 1) LED green. This discounts the possibility that the issue is simply a bad pixel in my hardware.