-
Notifications
You must be signed in to change notification settings - Fork 989
Open
Labels
questionQuestion about usage of TinyGoQuestion about usage of TinyGo
Description
I have tried running the example code for the max6675 temp sensor on a pi pico, resulting in the pico freezing and needing a reboot. I have tried changing the cables and switching the pico out, with no change.
Some simple troubleshooting showed, that the program hangs when it tries to read the sensor.
Getting desperate, i changed the SDI to SDO, with no luck.
In the following code, I have switched the pins from adafruit to pico
`func main() {
machine.GPIO17.Configure(machine.PinConfig{Mode: machine.PinOutput})
machine.GPIO17.High()
machine.SPI0.Configure(machine.SPIConfig{
Frequency: 1_000_000,
SCK: machine.GPIO18,
SDO: machine.GPIO16,
})
thermocouple := max6675.NewDevice(machine.SPI0, machine.GPIO17)
for {
temp, err := thermocouple.Read()
if err != nil {
println(err)
return
}
println("%0.02f C : %0.02f F\n", temp, (temp*9/5)+32)
time.Sleep(time.Second)
}
}`
Any ideas what could cause this in the example code?
Metadata
Metadata
Assignees
Labels
questionQuestion about usage of TinyGoQuestion about usage of TinyGo