Control a Piglow using Node-RED

Control a Piglow using Node-RED

By taking advantage of the node-piglow module, you can now control your Piglow using Node-RED.

Steps

  1. Install the node-piglow module: npm install node-piglow should do it.
  2. Add node-piglow to the node-red settings.js in the functionGlobalContext: functionGlobalContext: { piglow:require('piglow') }
  3. Launch Node-RED and add the flow below and start hacking! Check out the documentation here to see what you can do.

-James

[{"id":"185ab0fd.e7a54f","type":"inject","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":370,"y":180,"z":"56b706ba.a948f8","wires":[["5d792c19.a286d4"]]},{"id":"5d792c19.a286d4","type":"function","name":"Control Piglow","func":"var piGlow = context.global.piglow;\n\n\n//callback fires when board is initialized\npiGlow(function(error, pi) {\n\t\tpi.random;\n});\n\n\nreturn msg;","outputs":1,"x":554,"y":180,"z":"56b706ba.a948f8","wires":[[]]}]
jpwsutton

Flow Info

created 2 years, 11 months ago

Node Types

Core
  • function (x1)
  • inject (x1)

Tags

  • piglow
  • led
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option