diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2011-10-11 21:50:49 +0200 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2011-10-11 21:50:49 +0200 |
commit | 324c5ba9098c1010d0aa8c1e26b95509878ce9f2 (patch) | |
tree | f6ef2d537decaa2e1af6d4b9c4c31161b22333ec /liboctopus/python/demos/blink_all.py | |
download | mini-octopus-324c5ba9098c1010d0aa8c1e26b95509878ce9f2.tar.gz mini-octopus-324c5ba9098c1010d0aa8c1e26b95509878ce9f2.zip |
Mini-Octopus build from r@171
Diffstat (limited to 'liboctopus/python/demos/blink_all.py')
-rw-r--r-- | liboctopus/python/demos/blink_all.py | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/liboctopus/python/demos/blink_all.py b/liboctopus/python/demos/blink_all.py new file mode 100644 index 0000000..32c963b --- /dev/null +++ b/liboctopus/python/demos/blink_all.py @@ -0,0 +1,58 @@ +#blink_all.py +#laesst die led1 - led6 auf einmal blinken + +import sys + +sys.path.append("../../libs/python") + +from octopus import * +import time + + +op=octopus_context() +octopus_init(op) +octopus_open(op) +octopus_io_init(op,26) +octopus_io_init(op,27) +octopus_io_init(op,28) +octopus_io_init(op,29) +octopus_io_init(op,30) +octopus_io_init(op,31) +octopus_io_init(op,32) + +octopus_io_set_pin_direction_out(op,26) +octopus_io_set_pin_direction_out(op,27) +octopus_io_set_pin_direction_out(op,28) +octopus_io_set_pin_direction_out(op,29) +octopus_io_set_pin_direction_out(op,30) +octopus_io_set_pin_direction_out(op,31) +octopus_io_set_pin_direction_out(op,32) + +octopus_io_set_pin(op,26,0) +octopus_io_set_pin(op,27,0) +octopus_io_set_pin(op,28,0) +octopus_io_set_pin(op,29,0) +octopus_io_set_pin(op,30,0) +octopus_io_set_pin(op,31,0) +octopus_io_set_pin(op,32,0) + + + + +while 1: + octopus_io_set_pin(op,26,1) + octopus_io_set_pin(op,27,1) + octopus_io_set_pin(op,28,1) + octopus_io_set_pin(op,29,1) + octopus_io_set_pin(op,30,1) + octopus_io_set_pin(op,31,1) + octopus_io_set_pin(op,32,1) + time.sleep(1) + octopus_io_set_pin(op,26,0) + octopus_io_set_pin(op,27,0) + octopus_io_set_pin(op,28,0) + octopus_io_set_pin(op,29,0) + octopus_io_set_pin(op,30,0) + octopus_io_set_pin(op,31,0) + octopus_io_set_pin(op,32,0) + time.sleep(1) |