mirror of
https://github.com/kidoman/embd
synced 2024-12-22 12:50:19 +01:00
samples: simpleblinker rpi example
does not cleanup up after itself, but is concise
This commit is contained in:
parent
94f99476c2
commit
ad9dea5616
1
samples/.gitignore
vendored
1
samples/.gitignore
vendored
@ -17,6 +17,7 @@ pwm
|
||||
servo
|
||||
servobbb
|
||||
servoblaster
|
||||
simpleblinker
|
||||
tmp006
|
||||
us020
|
||||
watersensor
|
||||
|
20
samples/simpleblinker.go
Normal file
20
samples/simpleblinker.go
Normal file
@ -0,0 +1,20 @@
|
||||
// +build ignore
|
||||
|
||||
// Simple LED blinker, works OOTB on a RPi. However, it does not clean up
|
||||
// after itself. So might leave the LED On. The RPi is not harmed though.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/kidoman/embd"
|
||||
_ "github.com/kidoman/embd/host/rpi"
|
||||
)
|
||||
|
||||
func main() {
|
||||
for {
|
||||
embd.LEDToggle(0)
|
||||
time.Sleep(250 * time.Millisecond)
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user