From ad9dea56165212e01a7b30c3734fc5052732dd8c Mon Sep 17 00:00:00 2001 From: Karan Misra Date: Fri, 11 Apr 2014 09:21:31 +0530 Subject: [PATCH] samples: simpleblinker rpi example does not cleanup up after itself, but is concise --- samples/.gitignore | 1 + samples/simpleblinker.go | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 samples/simpleblinker.go diff --git a/samples/.gitignore b/samples/.gitignore index b5bdec4..76f5b5c 100644 --- a/samples/.gitignore +++ b/samples/.gitignore @@ -17,6 +17,7 @@ pwm servo servobbb servoblaster +simpleblinker tmp006 us020 watersensor diff --git a/samples/simpleblinker.go b/samples/simpleblinker.go new file mode 100644 index 0000000..584fbcf --- /dev/null +++ b/samples/simpleblinker.go @@ -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) + } +}