fix display offset
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
module m5stickc
|
||||
|
||||
go 1.25.8
|
||||
go 1.26.2
|
||||
|
||||
require tinygo.org/x/drivers v0.34.0
|
||||
|
||||
|
||||
+4
-7
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"image/color"
|
||||
"machine"
|
||||
"time"
|
||||
@@ -38,8 +39,8 @@ func main() {
|
||||
Model: st7735.MINI80x160,
|
||||
Width: 80,
|
||||
Height: 160,
|
||||
// ColumnOffset: 26,
|
||||
// RowOffset: 1,
|
||||
ColumnOffset: 26,
|
||||
RowOffset: 1,
|
||||
Rotation: st7735.ROTATION_270,
|
||||
})
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user