guile-inkplate/examples/date.scm

23 lines
756 B
Scheme
Raw Permalink Normal View History

(use-modules ((inkplate) #:prefix inkplate:)
2023-06-03 09:29:04 +02:00
(srfi srfi-19))
(let ((my-dev (inkplate:open "/dev/ttyUSB0")))
(inkplate:clear-screen my-dev)
(inkplate:set-cursor my-dev 280 100)
(inkplate:set-text-size my-dev 10)
(inkplate:print my-dev (inkplate:convert-string-to-hex (date->string (current-date) "~Y")))
(inkplate:set-cursor my-dev 275 180)
(inkplate:set-text-size my-dev 8)
(inkplate:print my-dev (inkplate:convert-string-to-hex (date->string (current-date) "~m-~d")))
(inkplate:draw-rectangle my-dev 270 90 250 155 3)
(inkplate:draw-rectangle my-dev 269 89 252 157 3)
(inkplate:draw-rectangle my-dev 268 88 254 159 3)
(inkplate:partial-update my-dev 15 800 600)
2023-06-03 09:29:04 +02:00
(inkplate:send my-dev)
(inkplate:close my-dev))