You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tested both an Arduino Nano and ESP32 module with the SSD1306 OLED module while using the Go machine package with the tinygo SSD1306 driver ("tinygo.org/x/drivers/ssd1306"). It seems no matter how I flash TinyGo code to the modules the SSD1306 will not work. I'm certain this is a configuration issue as I'm able to flash LEDs and button controls to the pins. Please let me know if there's a resolution on this that I'm missing out on.
For reference, this is my code to print "Hello world!" on the OLED screen:
package main
import (
"time"
"github.com/tinygo-org/tinygo/src/machine"
"tinygo.org/x/drivers/ssd1306"
)
func main() {
// Initialize I2C
machine.I2C0.Configure(machine.I2CConfig{
SCL: machine.IO22,
SDA: machine.IO21,
})
// Initialize the SSD1306 display
display := ssd1306.NewI2C(machine.I2C0)
display.Configure(ssd1306.Config{
Width: 128,
Height: 64,
})
display.ClearBuffer()
drawText(&display, 0, 0, "Hello World!")
display.Display()
for {
time.Sleep(time.Second)
}
}
func drawText(display *ssd1306.Device, x int16, y int16, text string) {
for i := int16(0); i < int16(len(text)); i++ {
display.SetPixel(x+i*6, y, 1) // Basic "dot" rendering for each character
}
}
I have tested both an Arduino Nano and ESP32 module with the SSD1306 OLED module while using the Go machine package with the tinygo SSD1306 driver ("tinygo.org/x/drivers/ssd1306"). It seems no matter how I flash TinyGo code to the modules the SSD1306 will not work. I'm certain this is a configuration issue as I'm able to flash LEDs and button controls to the pins. Please let me know if there's a resolution on this that I'm missing out on.
For reference, this is my code to print "Hello world!" on the OLED screen:
This is the error message I get:
The text was updated successfully, but these errors were encountered: