This commit is contained in:
didier committed 2024-07-30 22:09:14 -04:00
1 parent f18d0f36f1
commit 8b6e80c5ad
1 file changed
+5 -16
+5 -16
View File
@@ -6,6 +6,7 @@ import (
_ "go-orange/orangefork" _ "go-orange/orangefork"
"periph.io/x/conn/v3/gpio" "periph.io/x/conn/v3/gpio"
"periph.io/x/host/v3" "periph.io/x/host/v3"
"time"
) )
func main() { func main() {
@@ -25,21 +26,9 @@ func main() {
orangefork.PC1_15, orangefork.PC1_15,
orangefork.PC1_16, orangefork.PC1_16,
} }
for _, pin := range gpios { t := time.NewTicker(500 * time.Millisecond)
fmt.Printf("PC1_15 pull is : %s\n", pin.Pull().String()) for l := gpio.Low; ; l = !l {
fmt.Printf("PC1_15 Function is: %s\n", pin.Function()) orangefork.PC1_15.Out(l)
fmt.Printf("PC1_15 read is : %s\n", pin.Read()) <-t.C
}
if err := orangefork.PC1_15.Out(gpio.High); err != nil {
fmt.Printf("%s\n", err)
} else {
fmt.Println("No problem setting PC1_15 to High")
}
if err := orangefork.PC1_15.Out(gpio.Low); err != nil {
fmt.Printf("%s\n", err)
} else {
fmt.Println("No problem setting PC1_15 to Low")
} }
} }