Traget board : Arduino UNO.
Goal : Up-Down -> "Pull-up Resistor".
Result build : PinInputPullup not declared by package machine.
Code :
package main
import (
"machine"
"time"
)
const (
led = machine.Pin(13)
button = machine.Pin(12)
)
func main() {
led.Configure(machine.PinConfig{Mode: machine.PinOutput})
button.Configure(machine.PinConfig{Mode: machine.PinInputPullup})
for {
if !button.Get() {
led.High()
} else {
led.Low()
}
time.Sleep(time.Millisecond * 10)
}
}
Comment : Arduino UNO don't support Pull-up Resistors?