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
| -
!
-
|
|
|
|
|
|
|
|
!
| from PIL import Image
import smbus
import time
off_x=28
off_y=130
dx=8
dy=2
imax=75
jmax=16
i2c = smbus.SMBus(1) pixels=[[(0,0,0) for j in range(jmax)] for i in range(imax)]
addrs = [0x30,0x31,0x32,0x33]
fourpix=[0x00, 0x00, 0x04, 0,0,0, 0,0,0, 0,0,0, 0,0,0]
i2c.write_byte(addrs[0],0x00)
i2c.write_byte(addrs[1],0x00)
i2c.write_byte(addrs[2],0x00)
i2c.write_byte(addrs[3],0x00)
time.sleep(0.001)
i2c.write_byte(addrs[0],0x01)
i2c.write_byte(addrs[1],0x01)
i2c.write_byte(addrs[2],0x01)
i2c.write_byte(addrs[3],0x01)
|