guile-inkplate/examples/date.scm
Tom Willemse 05d734c903 Fix the date example
I stopped calling the original module ‘(inkplate lowlevel)’ since I don't have
any idea for a high-level API yet.
2023-07-12 15:13:01 -07:00

22 lines
737 B
Scheme

(use-modules ((inkplate) #:prefix inkplate:)
(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:update my-dev)
(inkplate:send my-dev)
(inkplate:close my-dev))