Skip to content

Instantly share code, notes, and snippets.

Here are the methods that a J5 IO-Plugin is expected to implement:

  • i2cWrite(address, inBytes)
  • i2cWrite(address, register, inBytes)
  • i2cWriteReg(address, register, value)
  • i2cRead(address, register, bytesToRead, handler)
  • i2cRead(address, bytesToRead, handler)
  • i2cReadOnce(address, register, bytesToRead, handler)
  • i2cReadOnce(address, bytesToRead, handler)
1430248080895 Device(s) RaspberryPi-IO
1430248080958 Connected RaspberryPi-IO
North
NorthEast by North
NorthEast by North
NorthEast by North
NorthEast by North
NorthEast by North
NorthEast by North
NorthEast by North
var five = require("johnny-five");
var BeagleBone = require("beaglebone-io");
var board = new five.Board({
io: new BeagleBone()
});
board.on("ready", function() {
var accelerometer = new five.Accelerometer({
controller: "ADXL345"
});
'use strict';
var SerialPort = require('serialport').SerialPort;
var calls = 0;
var serialPort = new SerialPort('/dev/ttyAMA0', {
baudrate: 115200,
parser: function() {
calls++;
#include <avr/io.h>
#include <avr/power.h>
#include <util/delay.h>
#define LED PB0
#define LED_DDR DDRB
#define LED_PORT PORTB
#define USART_BAUDRATE 115200
#define UBRR_VALUE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1)
pi@raspberrypi ~/dev $ npm install git://github.com/jgautier/firmata.git
-
> firmata@0.7.1-pre-2 postinstall /home/pi/dev/node_modules/firmata
> node scripts/postinstall
> serialport@2.0.1 install /home/pi/dev/node_modules/firmata/node_modules/serialport
> node-pre-gyp install --fallback-to-build
pi@raspberrypi ~/dev/j5 $ node -v
v4.2.0
pi@raspberrypi ~/dev/j5 $ npm install git://github.com/rwaldron/johnny-five.git
> firmata@0.7.1-pre-2 postinstall /home/pi/dev/node_modules/johnny-five/node_modules/firmata
> node scripts/postinstall
/
> serialport@2.0.1 install /home/pi/dev/node_modules/johnny-five/node_modules/firmata/node_modules/serialport
> node-pre-gyp install --fallback-to-build
debian@beaglebone:~/dev/sp10$ node -v
v0.10.38
debian@beaglebone:~/dev/sp10$ npm install serialport
\
> serialport@2.0.2 install /home/debian/dev/sp10/node_modules/serialport
> node-pre-gyp install --fallback-to-build
make: Entering directory '/home/debian/dev/sp10/node_modules/serialport/build'
CXX(target) Release/obj.target/serialport/src/serialport.o
CXX(target) Release/obj.target/serialport/src/serialport_unix.o
brian@linuxbox:~$ ./oneshot.sh
1. install dependencies
[sudo] password for brian:
Reading package lists... Done
Building dependency tree
Reading state information... Done
autoconf is already the newest version.
autoconf2.13 is already the newest version.
bison is already the newest version.
flex is already the newest version.
The target system is: Linux - - i686
The host system is: Linux - 3.13.0-74-generic - i686
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler: /usr/bin/c++
Build flags:
Id flags:
The output was:
0