Skip to content

Instantly share code, notes, and snippets.

@Torsten85
Created July 26, 2016 16:01
Show Gist options
  • Save Torsten85/dcf64f6c2c8a21cbeeacf3fa96b5686f to your computer and use it in GitHub Desktop.
Save Torsten85/dcf64f6c2c8a21cbeeacf3fa96b5686f 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