Last active
October 18, 2018 08:40
-
-
Save Pofay/e2fb9c21da4fbfee5fdddc983b1bc104 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
const Lcd = require('lcd'); | |
const moment = require('moment') | |
const lcd = new Lcd({ rs: 25, e: 24, data: [23, 17, 21, 22], cols: 16, rows: 2}) | |
lcd.on('ready', () => { | |
setInterval(() => { | |
lcd.setCursor(0, 0); | |
lcd.print(moment().format('h:mm:ss a'), (err) => { | |
if (err) { | |
throw err; | |
} | |
lcd.setCursor(0,1); | |
lcd.print('Hello There!', (err) => { | |
if(err) throw err; | |
}); | |
}); | |
}, 1000); | |
}); | |
process.on('SIGINT', () => { | |
lcd.close(); | |
process.exit(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment