summaryrefslogtreecommitdiff
path: root/liboctopus/python/demos/blink_lauf.py
blob: 00f73e70c4294e4d9c62c9713af280bca2a3ca5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#blink_lauf.py
#laesst alle leds nacheinander blinken

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)
    time.sleep(1)
    octopus_io_set_pin(op,26,0)
    time.sleep(0.5)     
    octopus_io_set_pin(op,27,1)
    time.sleep(1)
    octopus_io_set_pin(op,27,0)
    time.sleep(0.5)    
    octopus_io_set_pin(op,28,1)
    time.sleep(1)
    octopus_io_set_pin(op,28,0)
    time.sleep(0.5)    
    octopus_io_set_pin(op,29,1)
    time.sleep(1)
    octopus_io_set_pin(op,29,0)
    time.sleep(0.5)    
    octopus_io_set_pin(op,30,1)
    time.sleep(1)
    octopus_io_set_pin(op,30,0)
    time.sleep(0.5)
    octopus_io_set_pin(op,31,1)
    time.sleep(1)
    octopus_io_set_pin(op,31,0)
    time.sleep(0.5)
    octopus_io_set_pin(op,32,1)
    time.sleep(1)
    octopus_io_set_pin(op,32,0)
    time.sleep(0.5)