I know it's been a long time, but did you succeeded?
I tried another approach with the following code.
Code: Select all
package main
import (
"image/color"
"machine"
"time"
"tinygo.org/x/drivers/st7735"
)
var red = color.RGBA{255, 0, 0, 255}
var green = color.RGBA{0, 255, 0, 255}
func main() {
machine.SPI0.Configure(machine.SPIConfig{
Frequency: machine.TWI_FREQ_100KHZ,
})
resetPin := machine.TFT_RST
dcPin := machine.TFT_DC
csPin := machine.TFT_CS
backLightPin := machine.TFT_LITE
display := st7735.New(machine.SPI0, resetPin, dcPin, csPin, backLightPin)
display.Configure(st7735.Config{})
i := 0
for {
display.FillScreen(green)
time.Sleep(2 * time.Second)
display.FillScreen(red)
time.Sleep(2 * time.Second)
i++
}
}
But it only light the backlight and no sign of colors on the display.