fix display offset
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
module m5stickc
|
module m5stickc
|
||||||
|
|
||||||
go 1.25.8
|
go 1.26.2
|
||||||
|
|
||||||
require tinygo.org/x/drivers v0.34.0
|
require tinygo.org/x/drivers v0.34.0
|
||||||
|
|
||||||
|
|||||||
+8
-11
@@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"image/color"
|
"image/color"
|
||||||
"machine"
|
"machine"
|
||||||
"time"
|
"time"
|
||||||
@@ -35,12 +36,12 @@ func main() {
|
|||||||
machine.NoPin,
|
machine.NoPin,
|
||||||
)
|
)
|
||||||
display.Configure(st7735.Config{
|
display.Configure(st7735.Config{
|
||||||
Model: st7735.MINI80x160,
|
Model: st7735.MINI80x160,
|
||||||
Width: 80,
|
Width: 80,
|
||||||
Height: 160,
|
Height: 160,
|
||||||
// ColumnOffset: 26,
|
ColumnOffset: 26,
|
||||||
// RowOffset: 1,
|
RowOffset: 1,
|
||||||
Rotation: st7735.ROTATION_270,
|
Rotation: st7735.ROTATION_270,
|
||||||
})
|
})
|
||||||
|
|
||||||
red := color.RGBA{255, 0, 0, 255}
|
red := color.RGBA{255, 0, 0, 255}
|
||||||
@@ -64,11 +65,6 @@ func main() {
|
|||||||
buttonB.Configure(machine.PinConfig{Mode: machine.PinInput})
|
buttonB.Configure(machine.PinConfig{Mode: machine.PinInput})
|
||||||
|
|
||||||
for {
|
for {
|
||||||
// display.FillScreen(red)
|
|
||||||
// time.Sleep(500 * time.Millisecond)
|
|
||||||
// display.FillScreen(black)
|
|
||||||
// time.Sleep(500 * time.Millisecond)
|
|
||||||
|
|
||||||
valueA := buttonA.Get()
|
valueA := buttonA.Get()
|
||||||
valueB := buttonB.Get()
|
valueB := buttonB.Get()
|
||||||
|
|
||||||
@@ -83,5 +79,6 @@ func main() {
|
|||||||
} else {
|
} else {
|
||||||
display.FillRectangle(80, 0, 80, 80, black)
|
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