-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample.py
60 lines (52 loc) · 1.41 KB
/
example.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
57
58
59
60
# xbox_rf example script
#
# Example that shows how to use the
# xbox_rf librabry
#
# Created by Tino Goehlert
#
# www.astrorats.org | @_tin0_
import xbox_rf
# Initialize wiringPi and start
# Boot secuence.
print("initializing..")
xbox_rf.Init()
xbox_rf.BootAnimation()
print("done")
# Switch Green Edge LEDs on and off
print("start green light travel")
xbox_rf.SendCommand("green_ul",150)
xbox_rf.SendCommand("green_ur",150)
xbox_rf.SendCommand("green_dr",150)
xbox_rf.SendCommand("green_dl",150)
print("done")
# Switch all Green Edge LEDs on
print("full green ON")
xbox_rf.SendData("0010100001",150)
xbox_rf.SendData("0010100011",150)
xbox_rf.SendData("0010101011",150)
xbox_rf.SendData("0010101111",150)
print("done")
# Switch Red Edge LEDs on and off
print("start red light travel")
xbox_rf.SendCommand("red_ul",150)
xbox_rf.SendCommand("red_ur",150)
xbox_rf.SendCommand("red_dr",150)
xbox_rf.SendCommand("red_dl",150)
print("done")
# Switch all Red Edge LEDs on
print("full red ON")
xbox_rf.SendData("0010110001",150)
xbox_rf.SendData("0010110011",150)
xbox_rf.SendData("0010111011",150)
xbox_rf.SendData("0010111111",150)
print("done")
# shotdown all green Edge LEDs on
print("kill green lighting")
xbox_rf.SendData("0010101011",150)
xbox_rf.SendData("0010100111",150)
xbox_rf.SendData("0010100011",150)
xbox_rf.SendData("0010100001",150)
xbox_rf.SendData("0010100000",150)
print("done")
xbox_rf.SendData("0010110000",150)