Pygamer with tinygo

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jypelle
 
Posts: 2
Joined: Wed Nov 04, 2020 5:09 pm

Pygamer with tinygo

Post by jypelle »

Hi!

I'm using tinygo with my pygamer.

Buttons and the 5 neopixels are ok, but I encounter some issues with TFT:

When I configure SPI1 like this:

Code: Select all

	machine.SPI1.Configure(machine.SPIConfig{
		SCK:       machine.SPI1_SCK_PIN,
		SDO:       machine.SPI1_SDO_PIN,
		SDI:       machine.SPI1_SDI_PIN,
	})
, the pygamer crashes

Could you tell me what i missed ?

User avatar
TitiMoby
 
Posts: 10
Joined: Tue Sep 01, 2015 3:59 am

Re: Pygamer with tinygo

Post by TitiMoby »

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.

User avatar
jypelle
 
Posts: 2
Joined: Wed Nov 04, 2020 5:09 pm

Re: Pygamer with tinygo

Post by jypelle »

It succeed with Tinygo >=0.16 (or tinygo 0.15 with this fix: https://github.com/tinygo-org/tinygo/co ... a56fcdc725 )

I released a working template here: https://github.com/jypelle/xship

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”