first commit
This commit is contained in:
commit
a5a0434432
1126 changed files with 439481 additions and 0 deletions
28
Software/Go/grovepi_led.go
Normal file
28
Software/Go/grovepi_led.go
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/JGrotex/GrovePi/Software/Go/grovepi"
|
||||
)
|
||||
|
||||
func runLED() string {
|
||||
var g grovepi.GrovePi
|
||||
g = *grovepi.InitGrovePi(0x04)
|
||||
err := g.PinMode(grovepi.D3, "output")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
g.DigitalWrite(grovepi.D3, 1)
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
g.DigitalWrite(grovepi.D3, 0)
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
|
||||
return "done"
|
||||
}
|
||||
|
||||
func main() {
|
||||
runLED()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue