-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprogram.py
56 lines (47 loc) · 1.44 KB
/
program.py
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
import pyBallLib
serial_port = 'COM3'
zone_serial = '1026CCE9FBFDFBD8'
zone_channel = 0
# Create the zone
connection = pyBallLib.Connection(serial_port)
zone = pyBallLib.Zone(connection, zone_serial, zone_channel)
# First sequence
sequence = zone.bank(0).sequence(0)
# B0S0P0 black mouse clockwise
image = sequence.append_image(100, image_filename='mouseb.pbi')
position = sequence.append_position() # Create B0S0P0
position.image = image.index
position.columns = 355
position.gap = 255
position.scroll = 2 # LTR
position.frames = 500
# B0S0P1 red mouse anti-clockwise
image = sequence.append_image(100, image_filename='mouser.pbi')
position = sequence.append_position() # Create B0S0P1
position.image = image.index
position.columns = 355
position.gap = 255
position.scroll = 353 # RTL
position.frames = 500
# Second sequence
sequence = zone.bank(1).sequence(1)
sequence.repeat = 10
# B0S0P0 black mouse clockwise
image = sequence.append_image(100, image_filename='mouseb.pbi')
position = sequence.append_position() # Create B1S1P0
position.image = image.index
position.columns = 300
position.gap = 0
position.scroll = 0
position.frames = 10
# B0S0P1 red mouse anti-clockwise
image = sequence.append_image(100, image_filename='mouser.pbi')
position = sequence.append_position() # Create B1S1P1
position.image = image.index
position.columns = 300
position.gap = 0
position.scroll = 0
position.frames = 10
# Upload the data
zone.update_state()
zone.upload()