Skip to content

Instantly share code, notes, and snippets.

@padolsey
Last active February 21, 2024 11:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save padolsey/5e90c198b8d0c5cef03bea08d42010d3 to your computer and use it in GitHub Desktop.
Save padolsey/5e90c198b8d0c5cef03bea08d42010d3 to your computer and use it in GitHub Desktop.
'use strict'
const five = require('johnny-five');
const board = new five.Board();
board.on('ready', () => {
console.log('Ready');
let lcd = new five.LCD({
pins: [
12, // rs pin
11, // en pin
5, // d4 pin
4, // d5 pin
3, // d6 pin
2 // d7 pin
]
});
lcd.print('Ready on :8082');
require('http').createServer((req, res) => {
// Avoid favicon requests:
if (/favicon/.test(req.url)) {
return res.end('');
}
let msg = decodeURIComponent( req.url.replace(/^\//, '') );
lcd.cursor(0,0).print(msg + Array(16).join(' '));
res.end('Check the display :)');
}).listen(8082, () => {
console.log('Listening on :8082');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment