From 324c5ba9098c1010d0aa8c1e26b95509878ce9f2 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Tue, 11 Oct 2011 21:50:49 +0200 Subject: Mini-Octopus build from r@171 --- liboctopus/python/demos/blink_i2c.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 liboctopus/python/demos/blink_i2c.py (limited to 'liboctopus/python/demos/blink_i2c.py') diff --git a/liboctopus/python/demos/blink_i2c.py b/liboctopus/python/demos/blink_i2c.py new file mode 100644 index 0000000..5fd4cb9 --- /dev/null +++ b/liboctopus/python/demos/blink_i2c.py @@ -0,0 +1,29 @@ +# blink_i2c.py +# laesst die led des i2c (0x10) blinken + +import sys +sys.path.append("..\\..\\libs\\python") + +from octopus import * +import time + + +op=octopus_context() +octopus_init(op) +octopus_open(op) +octopus_i2c_init(op) +octopus_i2c_set_bitrate(op,3) # 100khz + + +octopus_i2c_send_start(op) + +while 1: + #octopus_i2c_receive_byte(op,0x10,1) + octopus_i2c_send_byte(op,0x20,1) + octopus_i2c_send_byte(op,1,1) + time.sleep(1) + octopus_i2c_send_byte(op,0x20,1) + octopus_i2c_send_byte(op,0,1) + time.sleep(1) + + -- cgit v1.2.1