Skip to content

Instantly share code, notes, and snippets.

@johnbahamon
Last active July 22, 2016 10:04
Show Gist options
  • Save johnbahamon/1ca90427fc3759d3f550cd76ee406390 to your computer and use it in GitHub Desktop.
Save johnbahamon/1ca90427fc3759d3f550cd76ee406390 to your computer and use it in GitHub Desktop.
var Printer = require('thermalprinter');
var Raspi = require("raspi-io");
var five = require("johnny-five");
var board = new five.Board({
io: new Raspi(),
port: "/dev/ttyAMA0"
});
board.on('ready', function() {
var printer = new Printer(board);
printer.on('ready', function() {
printer
.indent(10)
.horizontalLine(16)
.bold(true)
.indent(10)
.printLine('first line')
.bold(false)
.inverse(true)
.big(true)
.right()
.printLine('second line')
.print(function() {
console.log('done');
process.exit();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment