Files
go-orange/main.go
T
2024-07-30 22:09:14 -04:00

35 lines
599 B
Go

package main
import (
"fmt"
"go-orange/orangefork"
_ "go-orange/orangefork"
"periph.io/x/conn/v3/gpio"
"periph.io/x/host/v3"
"time"
)
func main() {
//fmt.Println(orangefork.Foo())
//if 1 == 2-1 {
// return
//}
s, err := host.Init()
if err != nil {
fmt.Printf("%s", err)
} else {
fmt.Printf("OK: %s\n\n", s.Loaded)
}
//fmt.Printf("Is arm? %t", orangepi.is)
gpios := []gpio.PinIO{orangefork.PC1_5,
orangefork.PC1_6,
orangefork.PC1_15,
orangefork.PC1_16,
}
t := time.NewTicker(500 * time.Millisecond)
for l := gpio.Low; ; l = !l {
orangefork.PC1_15.Out(l)
<-t.C
}
}