Example using Johnny-Five + Raspi-IO to directly control a Raspberry Pi

LED on pin P1-13

led-13-raspberry-pi.png

Fritzing diagram: led-13-raspberry-pi.fzz

 

Run this example from the command line with:

node eg/raspi-io.js
var five = require("johnny-five");
var Raspi = require("raspi-io");
var board = new five.Board({
  io: new Raspi()
});

board.on("ready", function() {
  var led = new five.Led("P1-13");
  led.blink();
});


Additional Notes

In order to use the Raspi-IO library, it is recommended that you use the Raspbian OS. Others may work, but are untested.

npm install johnny-five raspi-io

Learn More

 

Component Classes in this example:

Hi! The Johnny-Five community is building new projects every day. We made this newsletter to tell you about what's new, what's good, and what's next for Open Source robotics. Join us in exploring what we can make together.

Fork me on GitHub