Last active
February 21, 2024 11:49
-
-
Save padolsey/5e90c198b8d0c5cef03bea08d42010d3 to your computer and use it in GitHub Desktop.
This file contains 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
'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