guile-inkplate/examples/date.scm
Tom Willemse 27cbc844de Send a partial update in the date example
From what I've read it's not good to always do full updates, so for examples and
testing I figure that doing a partial update of the whole screen is also good.
2023-07-12 15:13:34 -07:00

22 lines
756 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:partial-update my-dev 15 800 600)
(inkplate:send my-dev)
(inkplate:close my-dev))