Last active
July 22, 2016 10:04
-
-
Save johnbahamon/1ca90427fc3759d3f550cd76ee406390 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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