-
Notifications
You must be signed in to change notification settings - Fork 997
Closed
Labels
Description
I just wanted to flash a very basic program to an ESP32 and got this error:
PS C:\Users\ingwi\Work\esp32-test> tinygo flash -target=esp32 ./main.go
# machine
C:\Users\ingwi\tinygo\src\machine\machine_esp32_i2c.go:38:16: undefined: SCL_PIN
C:\Users\ingwi\tinygo\src\machine\machine_esp32_i2c.go:41:16: undefined: SDA_PIN
I clearned out the tonygo folder before upgrading.
PS C:\Users\ingwi\Work\esp32-test> tinygo version
tinygo version 0.36.0 windows/amd64 (using go version go1.24.0 and LLVM version 19.1.2)
PS C:\Users\ingwi\Work\esp32-test> go version
go version go1.24.0 windows/amd64
Here is the main.go that I tried to compile:
package main
import (
"machine"
"time"
)
var counter int
func handleInterrupt(machine.Interrupt) {
counter++
}
func main() {
button := machine.GPIO4 // Change to your desired pin
button.Configure(machine.PinConfig{Mode: machine.PinInputPullup})
interrupt := machine.NewInterrupt(button, machine.PinFalling, handleInterrupt)
interrupt.Enable()
for {
println("Counter:", counter)
time.Sleep(time.Second)
}
}The same also happens when I try to use an existing example:
PS C:\Users\ingwi\Work\esp32-test> tinygo flash -target=esp32 examples/blinky1
# machine
C:\Users\ingwi\tinygo\src\machine\machine_esp32_i2c.go:38:16: undefined: SCL_PIN
C:\Users\ingwi\tinygo\src\machine\machine_esp32_i2c.go:41:16: undefined: SDA_PIN
Did I miss anything...?