mirror of
https://github.com/wahyd4/arduino-coffeescript-playground.git
synced 2026-08-09 04:56:03 +10:00
add LCD time counter
This commit is contained in:
+6
-8
@@ -3,19 +3,17 @@ board = new five.Board()
|
||||
|
||||
board.on 'ready', ()->
|
||||
lcd = new five.LCD {
|
||||
#I don't know why it doesn't work when I use 1, 2, 3, 4 as DB4, DB5, DB6 ,DB7
|
||||
#LCD pin name RS EN DB4 DB5 DB6 DB7
|
||||
#I don't know why it doesn't work when I use 1, 2, 3, 4 as DB4, DB5, DB6 ,DB7
|
||||
#LCD pin name RS EN DB4 DB5 DB6 DB7
|
||||
pins: [10, 11, 4, 5, 6, 7]
|
||||
}
|
||||
lcd.on 'ready', ()->
|
||||
lcd.useChar("check");
|
||||
lcd.useChar("heart");
|
||||
lcd.useChar("duck");
|
||||
lcd.useChar("heart")
|
||||
|
||||
lcd.clear().print("Junv:");
|
||||
lcd.cursor(1, 0);
|
||||
lcd.clear().print("Junv:")
|
||||
lcd.cursor(1, 0)
|
||||
|
||||
lcd.print("I :heart: Johnny-five");
|
||||
lcd.print("I :heart: Johnny-five")
|
||||
|
||||
|
||||
return
|
||||
@@ -0,0 +1,18 @@
|
||||
five = require 'johnny-five'
|
||||
board = new five.Board()
|
||||
|
||||
board.on 'ready', ()->
|
||||
lcd = new five.LCD {
|
||||
pins: [10, 11, 4, 5, 6, 7]
|
||||
}
|
||||
initTime = new Date()
|
||||
lcd.on 'ready', ()->
|
||||
setInterval ()->
|
||||
lcd.clear()
|
||||
lcd.print 'Current time is:'
|
||||
lcd.cursor(1, 0)
|
||||
time = new Date() - initTime
|
||||
lcd.print "#{time}"
|
||||
return
|
||||
, 500
|
||||
return
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 755 KiB |
Reference in New Issue
Block a user