node package manager
Don’t reinvent the wheel. Reuse code within your team. Create a free org »

pi_node_examples

Node.js Examples for the Raspberry Pi

This repo is part of the Node.js Embedded Development on the Raspberry Pi guide.

Installing

Run the following on your Raspberry Pi. This is assuming you have already installed node.js.

$ git clone https://github.com/adafruit/Pi_Node_Example.git ~/pi_examples && cd pi_examples
$ npm install

Included Examples

  • node blink.js - blink a LED attached to GPIO pin 18 every second.
  • node stream_stdout.js - demonstrates the use of node.js streams by piping button presses to the terminal
  • node stream_led - demonstrates the use of node.js streams by piping button presses to a LED attached on pin 18
  • node stream_browser.js - a more complex example that demonstrates the use of node.js streams by piping button presses to a LED and a web browser

Circuit

Circuit

This shows the circuit you will need to connect in order to run this example code. If you would like more info, please visit the guide.

License

Copyright (c) 2014 Adafruit Industries. Licensed under the MIT license.