Last change
on this file since 5adf567 was 8cc14b9, checked in by Norbert Wigbels <njw@…>, 9 years ago |
Aufraeumen
|
-
Property mode
set to
100644
|
File size:
291 bytes
|
Rev | Line | |
---|
[8cc14b9] | 1 | require 'pi_piper'
|
---|
| 2 | include PiPiper
|
---|
| 3 |
|
---|
| 4 | trigger_watch = 0
|
---|
| 5 |
|
---|
| 6 | watch :pin => 11, :trigger => :falling do
|
---|
| 7 | puts('trigger registered')
|
---|
| 8 | trigger_watch = 1
|
---|
| 9 | end
|
---|
| 10 |
|
---|
| 11 | loop do
|
---|
| 12 | if trigger_watch == 1 then
|
---|
| 13 | puts('trigger 1 detected')
|
---|
| 14 | trigger_watch = 0
|
---|
| 15 | else
|
---|
| 16 | puts('trigger 0 detected')
|
---|
| 17 | end
|
---|
| 18 | sleep(5)
|
---|
| 19 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.