Home

Awesome

chip-io

logo

Johnny-Five IO Plugin for the Next Thing Co. C.H.I.P.

Prerequisites

NOTE: Some GPIO pins require root or sudo.

Getting Started

npm install chip-io johnny-five

NOTE: Must be run on the C.H.I.P. itself.

Boilerplate Program

var five = require('johnny-five');
var chipio = require('chip-io');

var board = new five.Board({
  io: new chipio()
});

board.on('ready', function() {
  // do Johnny-Five stuff
});

Examples

See examples folder as well as Johnny-Five examples.

API

See Johnny-Five API docs.

Pin Guide

Johnny-Five Compatible NameNumberSupported ModesRequires root or sudoInfo
LCD-D217Input
PWM018Input, Output, PWM
LCD-D419Input, Output
LCD-D320Input, Output
LCD-D621Input, Output
LCD-D522Input, Output
LCD-D1023Input, Output
LCD-D724Input, Output
LCD-D1225Input, Output
LCD-D1126Input, Output
LCD-D1427Input, Output
LCD-D1328Input, Output
LCD-D1829Input, Output
LCD-D1530Input, Output
LCD-D2031Input, Output
LCD-D1932Input, Output
LCD-D2233Input, Output
LCD-D2134Input, Output
LCD-CLK35Input, Output
LCD-D2336Input, Output
LCD-VSYNC37Input, Output
LCD-HSYNC38Input, Output
LCD-DE40Input, Output
LRADC51Analog
XIO-P053Input, OutputConnected to the built-in PCF8574A IO extender
XIO-P154Input, OutputConnected to the built-in PCF8574A IO extender
XIO-P255Input, OutputConnected to the built-in PCF8574A IO extender
XIO-P356Input, OutputConnected to the built-in PCF8574A IO extender
XIO-P457Input, OutputConnected to the built-in PCF8574A IO extender
XIO-P558Input, OutputConnected to the built-in PCF8574A IO extender
XIO-P659Input, OutputConnected to the built-in PCF8574A IO extender
XIO-P760Input, OutputConnected to the built-in PCF8574A IO extender
CSIPCK67Input
CSICK68Input
CSIHSYNC69Input
CSIVSYNC70Input, Output
CSID071Input, Output
CSID172Input, Output
CSID273Input, Output
CSID374Input, Output
CSID475Input, Output
CSID576Input, Output
CSID677Input, Output
CSID778Input, Output
I2CI2CUses I2C port 2 (TWI2-SCK and TWI2-SDA). Address 0x38 is used by the built-in PCF8574A IO extender

C.H.I.P. pinouts

Additional Features

TypeUsageJohnny-Five typeNotes
Battery Voltagenew chipio.BatteryVoltage();five.SensorReads battery voltage from the AXP209
Internal Temperaturenew chipio.InternalTemperature();five.ThermometerReads internal temperature from the AXP209
Onboard Buttonnew chipio.OnboardButton();five.ButtonUse onboard button (beside LCD-DE pin) connected to the AXP209
Status LEDnew chipio.StatusLed;five.LedControls status LED connected to GPIO2 on the AXP209