2014-03-02 08:06:34 +01:00
|
|
|
// +build ignore
|
|
|
|
|
2014-03-01 15:49:44 +01:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2014-04-04 22:13:16 +02:00
|
|
|
"flag"
|
2014-03-01 15:49:44 +01:00
|
|
|
"time"
|
|
|
|
|
2014-03-02 20:21:23 +01:00
|
|
|
"github.com/kidoman/embd"
|
2014-04-06 03:20:09 +02:00
|
|
|
|
|
|
|
_ "github.com/kidoman/embd/host/all"
|
2014-03-01 15:49:44 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2014-04-04 22:13:16 +02:00
|
|
|
flag.Parse()
|
|
|
|
|
2014-03-02 20:21:23 +01:00
|
|
|
if err := embd.InitGPIO(); err != nil {
|
2014-03-01 15:49:44 +01:00
|
|
|
panic(err)
|
|
|
|
}
|
2014-03-02 20:21:23 +01:00
|
|
|
defer embd.CloseGPIO()
|
2014-03-01 15:49:44 +01:00
|
|
|
|
2014-03-02 20:21:23 +01:00
|
|
|
if err := embd.SetDirection(10, embd.Out); err != nil {
|
2014-03-01 15:49:44 +01:00
|
|
|
panic(err)
|
|
|
|
}
|
2014-03-02 20:21:23 +01:00
|
|
|
if err := embd.DigitalWrite(10, embd.High); err != nil {
|
2014-03-01 15:49:44 +01:00
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
time.Sleep(1 * time.Second)
|
|
|
|
|
2014-03-02 20:21:23 +01:00
|
|
|
if err := embd.SetDirection(10, embd.In); err != nil {
|
2014-03-01 15:49:44 +01:00
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|