From 0ac427a16fd9d20974b7c2579b5dc3be7b681cf2 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Fri, 10 Apr 2026 16:51:02 -0500 Subject: [PATCH] fix display offset --- m5stickc/go.mod | 2 +- m5stickc/main.go | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/m5stickc/go.mod b/m5stickc/go.mod index 12e78d7..0f38843 100644 --- a/m5stickc/go.mod +++ b/m5stickc/go.mod @@ -1,6 +1,6 @@ module m5stickc -go 1.25.8 +go 1.26.2 require tinygo.org/x/drivers v0.34.0 diff --git a/m5stickc/main.go b/m5stickc/main.go index 00f7973..e208b11 100644 --- a/m5stickc/main.go +++ b/m5stickc/main.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "image/color" "machine" "time" @@ -35,12 +36,12 @@ func main() { machine.NoPin, ) display.Configure(st7735.Config{ - Model: st7735.MINI80x160, - Width: 80, - Height: 160, - // ColumnOffset: 26, - // RowOffset: 1, - Rotation: st7735.ROTATION_270, + Model: st7735.MINI80x160, + Width: 80, + Height: 160, + ColumnOffset: 26, + RowOffset: 1, + Rotation: st7735.ROTATION_270, }) red := color.RGBA{255, 0, 0, 255} @@ -64,11 +65,6 @@ func main() { buttonB.Configure(machine.PinConfig{Mode: machine.PinInput}) for { - // display.FillScreen(red) - // time.Sleep(500 * time.Millisecond) - // display.FillScreen(black) - // time.Sleep(500 * time.Millisecond) - valueA := buttonA.Get() valueB := buttonB.Get() @@ -83,5 +79,6 @@ func main() { } else { display.FillRectangle(80, 0, 80, 80, black) } + fmt.Printf("Button A: %v, Button B: %v\n", valueA, valueB) } }