You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
308 B
Go
24 lines
308 B
Go
package main
|
|
|
|
import (
|
|
"time"
|
|
|
|
"periph.io/x/conn/v3/gpio"
|
|
"periph.io/x/conn/v3/gpio/gpioreg"
|
|
"periph.io/x/host/v3"
|
|
)
|
|
|
|
func main() {
|
|
host.Init()
|
|
|
|
pin := gpioreg.ByName("GPIO11")
|
|
pin.Out(gpio.Low)
|
|
|
|
for {
|
|
pin.Out(gpio.High)
|
|
time.Sleep(time.Second)
|
|
pin.Out(gpio.Low)
|
|
time.Sleep(time.Second)
|
|
}
|
|
}
|