forked from jloosli/Adafruit-Raspberry-Pi-Python-Code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex_8x8_pixels2.py
39 lines (33 loc) · 930 Bytes
/
ex_8x8_pixels2.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
#!/usr/bin/python
import time
import datetime
from random import randrange
from Adafruit_8x8 import EightByEight
import Adafruit_LEDBackpack
# ===========================================================================
# 8x8 Pixel Example
# ===========================================================================
grid = EightByEight(address=0x70)
led = Adafruit_LEDBackpack.LEDBackpack(0x70)
led.setBrightness=1
print "Press CTRL+Z to exit"
display=0
# Continually update the 8x8 display one pixel at a time
while(True):
for x in range(0, 8):
for y in range(0, 8):
grid.setPixel(x, y)
time.sleep(0.05)
time.sleep(0.5)
grid.clear()
time.sleep(0.5)
for x in range(0,8):
for y in range(0,8):
grid.setPixel(randrange(8), randrange(8))
time.sleep(0.05)
time.sleep(0.5)
grid.clear()
time.sleep(0.5)
# display += 1
#3 print "Display: %d" % display
# led.setBrightness=display