From af74f073a1ae5b37b6014f04bb8d68c18f50e634 Mon Sep 17 00:00:00 2001 From: Gregor Riepl Date: Thu, 6 May 2021 10:30:50 +0200 Subject: [PATCH] Debug output on second line --- uncanny/can.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/uncanny/can.go b/uncanny/can.go index b682500..6a8d9fb 100644 --- a/uncanny/can.go +++ b/uncanny/can.go @@ -5,6 +5,7 @@ import ( "fmt" "log" "github.com/brutella/can" + "time" ) const queueSize = 10 @@ -171,5 +172,16 @@ func (c *Can) Initialize() { c.bus.Publish(EncodePowerRequest()) c.bus.Publish(EncodeDisplayRequest()) c.DisplayPrint(0, "Hello world") + go func() { + t := time.Tick(100 * time.Millisecond) + var d rune + for { + select { + case <-t: + c.DisplayPrint(1, string([]rune{d})) + d = (d + 1) & 0xff + } + } + }() } }