Skip to content

Instantly share code, notes, and snippets.

@jpwsutton
Created July 26, 2014 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpwsutton/fcb8000bb7c61b9b019b to your computer and use it in GitHub Desktop.
Save jpwsutton/fcb8000bb7c61b9b019b to your computer and use it in GitHub Desktop.
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":[[]]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment