-
Notifications
You must be signed in to change notification settings - Fork 0
/
Eye_test.py
108 lines (90 loc) · 3.42 KB
/
Eye_test.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import smbus
import time
b = smbus.SMBus(1)
#define CLR_SCR_COMMAND 0xFF //очистить RGB матрицу
#define OFF_LED_CLOCKWISE 0xFE //выключение светодиодов по часовой стрелке
#define OFF_LED_ANTICLOCKWISE 0xFD //выключение светодиодов против часовой стрелке
#define ON_LED_CLOCKWISE 0xFC //включение светодиодов по часовой стрелке
#define ON_LED_ANTICLOCKWISE 0xFB //включение светодиодов против часовой стрелке
#define PLAY_ANIMATION 0xFA //проиграть анимацию зашитую в памяти контроллера RGB
#define SET_ADDRESS 0x0A //установить адрес I2C
#define ON_LED_NOW 0xF9 //включить светодиод
#
#WRITE ADRESS
# pak = [0xAA, 0x0A, 0x5E, 0, 0, 0, 0,0]#252
# b.write_i2c_block_data(0x5f, 0, pak)
# time.sleep(2)
#pak=[170,252,2,1,80,3,30,0]
#write_i2c_block_data(int addr,char cmd,long vals[])
#time.sleep(1)
#pakkets addr,reg , color 2 red -3 green -4 blue ,start led ,stop led ,step,time,0,
#uint8_t color, uint8_t startLED, uint8_t finishLED, uint8_t stepLED, uint8_t delayLED, uint8_t delayFrame
#
i = 0
while i < 1000000:
pak=[170,255,0,0,0,0,5,0]
b.write_i2c_block_data(0x5f,0,pak)
time.sleep(0.005)
pak=[170,255,0,0,0,0,5,0]
b.write_i2c_block_data(0x5E,0,pak)
time.sleep(0.005)
pak = [170, 0xFC, 2, 1, 80, 1, 4,0]#252
b.write_i2c_block_data(0x5F, 0, pak)
time.sleep(0.005)
pak = [170, 0xFB, 2, 80, 1, 1, 4,0]#252
b.write_i2c_block_data(0x5E, 0, pak)
time.sleep(0.400)
pak = [170, 0xFE, 2, 1, 80, 1, 4,0]#252
b.write_i2c_block_data(0x5F, 0, pak)
time.sleep(0.005)
pak = [170, 0xFE, 2, 1, 80, 1, 4,0]#252
b.write_i2c_block_data(0x5E, 0, pak)
time.sleep(0.400)
pak=[170,255,0,0,0,0,5,0]
b.write_i2c_block_data(0x5f,0,pak)
time.sleep(0.005)
pak=[170,255,0,0,0,0,5,0]
b.write_i2c_block_data(0x5E,0,pak)
time.sleep(0.005)
pak = [170, 0xFC, 4, 1, 80, 1, 4,0]#252
b.write_i2c_block_data(0x5F, 0, pak)
time.sleep(0.005)
pak = [170, 0xFB, 4, 80, 1, 1, 4,0]#252
b.write_i2c_block_data(0x5E, 0, pak)
time.sleep(0.400)
pak = [170, 0xFE, 4, 1, 80, 1, 4,0]#252
b.write_i2c_block_data(0x5F, 0, pak)
time.sleep(0.005)
pak = [170, 0xFE, 4, 1, 80, 1, 4,0]#252
b.write_i2c_block_data(0x5E, 0, pak)
time.sleep(0.400)
pak=[170,255,0,0,0,0,5,0]
b.write_i2c_block_data(0x5f,0,pak)
time.sleep(0.005)
pak=[170,255,0,0,0,0,5,0]
b.write_i2c_block_data(0x5E,0,pak)
time.sleep(0.005)
pak = [170, 0xFC, 3, 1, 80, 1, 4,0]#252
b.write_i2c_block_data(0x5F, 0, pak)
time.sleep(0.005)
pak = [170, 0xFB, 3, 80, 1, 1, 4,0]#252
b.write_i2c_block_data(0x5E, 0, pak)
time.sleep(0.400)
pak = [170, 0xFE, 3, 1, 80, 1, 4,0]#252
b.write_i2c_block_data(0x5F, 0, pak)
time.sleep(0.005)
pak = [170, 0xFE, 3, 1, 80, 1, 4,0]#252
b.write_i2c_block_data(0x5E, 0, pak)
time.sleep(0.400)
# pak = [170, 0xFC, 3, 1, 80, 4, 30, 0]
# b.write_i2c_block_data(0x5f, 0, pak)
#time.sleep(5)
#pak = [170, 0xFF, 0, 0, 0, 0, 0, 0]
#b.write_i2c_block_data(0x5f, 0, pak)
# for i in range(1,80):
# pak = [170, 252, 2, i, i, 1, 30, 0]
# b.write_i2c_block_data(0x5f, 0, pak)
# time.sleep(0.1)
# pak = [170, 255, 0, 0, 0, 0, 0, 0]
# b.write_i2c_block_data(0x5f, 0, pak)
# time.sleep(0.1)