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

Operating on ranges doesn't work correctly in RGB+W mode #27

Closed nbogie closed 6 years ago

nbogie commented 6 years ago

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

let item: neopixel.Strip = null
item = neopixel.create(DigitalPin.P0, 20, NeoPixelMode.RGBW)
item.range(0, 10).showColor(neopixel.colors(NeoPixelColors.Green))

Expected Behaviour: Should see pixels 0 - 9 all green

Actual Behaviour: Pixels 0 - 6 are Green,Blue,Red,Green,Blue,Red,Green, 7-9 not lit (on simulator and on real RGBW neopixels) rgbw_microbit_range_issue

(Switching between the other neopixel modes shows this working ok in GRB or RGB but not RGBW.)

Test Platform: Chrome 67.0.3396.62 and Safari 11.1, both on OSX 10.13.4

pelikhan commented 6 years ago

Fixed by https://github.com/Microsoft/pxt-neopixel/commit/1deade1a060f228439a94aef86d8c074cbed5225

pelikhan commented 6 years ago

Thanks for reporting!