Skip to content

Instantly share code, notes, and snippets.

@goliatone
Forked from Torsten85/index.js
Created February 18, 2017 20:37
Show Gist options
  • Save goliatone/3eef946b5eac03233d665129af822e92 to your computer and use it in GitHub Desktop.
Save goliatone/3eef946b5eac03233d665129af822e92 to your computer and use it in GitHub Desktop.
JohnnyFive / chip-io / oled
var five = require('johnny-five');
var Chip = require('chip-io');
var Oled = require('oled-js');
var io = new Chip();
io.i2cConfig({
address: 0x3c,
bus: 2
});
var board = new five.Board({
io: io
});
board.on('ready', function () {
var oled = new Oled(board, five, {
width: 128,
height: 64,
address: 0x3c
});
this.repl.inject({oled: oled});
oled.fillRect(1, 1, 10, 20, 1);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment