nicebadge/tutorial/basics/step0/main.go

29 lines
421 B
Go

package main
import (
"machine"
"time"
)
func main() {
// get the built-in LED pin on the nice!nano board
led := machine.LED
// configure the LED pin for output
led.Configure(machine.PinConfig{Mode: machine.PinOutput})
for {
// turn off the LED
led.Low()
// wait 500 ms
time.Sleep(time.Millisecond * 500)
// turn on the LED
led.High()
// wait 500 ms
time.Sleep(time.Millisecond * 500)
}
}