30 lines
476 B
Go
30 lines
476 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"periph.io/x/conn/v3/gpio"
|
|
"periph.io/x/host/v3"
|
|
"periph.io/x/host/v3/orangepi"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
s, err := host.Init()
|
|
if err != nil {
|
|
fmt.Printf("%s", err)
|
|
} else {
|
|
fmt.Printf("OK: %s\n\n", s)
|
|
}
|
|
//fmt.Printf("Is arm? %t", orangepi.is)
|
|
t := time.NewTicker(500 * time.Millisecond)
|
|
for l := gpio.Low; ; l = !l {
|
|
err := orangepi.PA1_8.Out(l)
|
|
if err != nil {
|
|
fmt.Printf("%s", err)
|
|
}
|
|
<-t.C
|
|
fmt.Println("tick")
|
|
|
|
}
|
|
}
|