phoddie / node-red-mcu

Node-RED for microcontrollers
120 stars 18 forks source link

fix neopixels (when arguments are 4 and 5) #82

Closed NW-Lab closed 1 year ago

NW-Lab commented 1 year ago

with four arguments For "msg.payload=[6,0,255,0]", the 7th and subsequent LEDs were lit. Fixed so that the 6th and subsequent LEDs light up.

with 5 arguments When "msg.payload=[6,10,0,255,0]", only the 7th LED was lit. Changed to light up from 6th to 10th.

NW-Lab commented 1 year ago

This is the confirmed flow.

[{"id":"8189e65d700f058c","type":"tab","label":"CheckNeopixels","disabled":false,"info":"","env":[],"_mcu":{"mcu":true}},{"id":"3af8aea2e8667478","type":"inject","z":"8189e65d700f058c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[6,10,100,0,0]","payloadType":"json","_mcu":{"mcu":true},"x":150,"y":140,"wires":[["8bacb563ca7573f2"]]},{"id":"8bacb563ca7573f2","type":"mcu_neopixels","z":"8189e65d700f058c","name":"","pin":"","length":"","order":"RGB","mode":"2","background":"#000000","foreground":"#2ecd59","wipe":"40","brightness":"52","_mcu":{"mcu":true},"x":380,"y":140,"wires":[]},{"id":"40cd9c5a585e8706","type":"inject","z":"8189e65d700f058c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"3","payloadType":"num","_mcu":{"mcu":true},"x":150,"y":240,"wires":[["8bacb563ca7573f2"]]},{"id":"8401c4b0763e7e9c","type":"inject","z":"8189e65d700f058c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[6,0,100,0]","payloadType":"json","_mcu":{"mcu":true},"x":140,"y":180,"wires":[["8bacb563ca7573f2"]]}]

phoddie commented 1 year ago

@NextWorldLab – thank you for the patch. I've merged that.

This repository uses follows the same contribution policy as the Moddable SDK, which requires a CLA (Contributor License Agreement). Because this PR is a small change, it is not strictly required. But, we would prefer to have the CLA on file. If possible, please complete the CLA. Thank you for your understanding.