Neopixels node(!) #50
phoddie
started this conversation in
Show and tell
Replies: 2 comments 1 reply
-
|
It works on M5Atom Matrix by changing |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
It works on M5Stack Fire by changing |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This one is kind of fun. I recently committed a Neopixels Node for Node-RED MCU Edition. It is based on the Neopixels node for Raspberry Pi and works on ESP32 family and Pico W devices. It implements all colors and modes of the original, and all the animations. Here's a short video that uses a simple animation running on an ESP32-S3.
neopixels.mov
The flow shown in this video is very simple. It uses a
completenode to receive a notification when the current animation completes. The complete node then causes "random color" node to choose another color.Here's the JSON so you can give it a try:
flows.json
[ { "id": "8471ec6d0c159c31", "type": "tab", "label": "neopixel demo", "disabled": false, "info": "", "env": [] }, { "id": "745e35dcb1b1886b", "type": "inject", "z": "8471ec6d0c159c31", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "payload": "red,green,blue,white,cyan,yellow,purple,orange", "payloadType": "str", "x": 150, "y": 180, "wires": [ [ "5d799e649b54a1a3" ] ] }, { "id": "eb234d064a2a6930", "type": "rpi-neopixels", "z": "8471ec6d0c159c31", "name": "", "gpio": 18, "pixels": "12", "bgnd": "", "fgnd": "", "wipe": "40", "mode": "pcent", "rgb": "grb", "brightness": "100", "gamma": false, "x": 550, "y": 180, "wires": [] }, { "id": "2420e7cde0ed735b", "type": "debug", "z": "8471ec6d0c159c31", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 550, "y": 260, "wires": [] }, { "id": "0d1014c10414c0e3", "type": "complete", "z": "8471ec6d0c159c31", "name": "", "scope": [ "eb234d064a2a6930" ], "uncaught": false, "x": 130, "y": 260, "wires": [ [ "5d799e649b54a1a3" ] ] }, { "id": "5d799e649b54a1a3", "type": "function", "z": "8471ec6d0c159c31", "name": "random color", "func": "const colors = context.get(\"colors\")\n\ndo {\n msg.payload = colors[Math.trunc(Math.random() * colors.length)];\n} while (context.get(\"previous\") === msg.payload);\n\ncontext.set(\"previous\", msg.payload);\n\nreturn msg;\n", "outputs": 1, "noerr": 0, "initialize": "const colors = [\"red\",\"green\",\"blue\",\"white\",\"cyan\",\"yellow\",\"purple\",\"orange\",\"black\",\"pink\"]\n\ncontext.set(\"colors\", colors);\n", "finalize": "", "libs": [], "x": 340, "y": 220, "wires": [ [ "eb234d064a2a6930", "2420e7cde0ed735b" ] ] } ]The Neopixels node works with the M5Atom Matrix which has a 5x5 grid of Neopixels. It should work with any Neopixels strand you have attached to your MCU.
Beta Was this translation helpful? Give feedback.
All reactions