Guest User

Untitled

a guest
Oct 18th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. const Lcd = require('lcd');
  2. const moment = require('moment')
  3. const lcd = new Lcd({ rs: 25, e: 24, data: [23, 17, 21, 22], cols: 16, rows: 2})
  4.  
  5. lcd.on('ready', () => {
  6. setInterval(() => {
  7. lcd.setCursor(0, 0);
  8. lcd.print(moment().format('h:mm:ss a'), (err) => {
  9. if (err) {
  10. throw err;
  11. }
  12. lcd.setCursor(0,1);
  13. lcd.print('Hello There!', (err) => {
  14. if(err) throw err;
  15. });
  16. });
  17. }, 1000);
  18. });
  19.  
  20. process.on('SIGINT', () => {
  21. lcd.close();
  22. process.exit();
  23. });
Add Comment
Please, Sign In to add comment