Exemplo n.º 1
0
import RPi.GPIO as gpio
from MyMax7219 import MyMatrix
from random import randint
import time

gpio.setmode(gpio.BCM)
taster = 23
gpio.setup(taster,gpio.IN,pull_up_down=gpio.PUD_UP)
matrix = MyMatrix()

def neue_zahl(channel):
  matrix.letter(str(randint(1,6)))

gpio.add_event_detect(taster, gpio.RISING,
        callback=neue_zahl)

matrix.letter("?")

while True:
  time.sleep(0.01)
Exemplo n.º 2
0
from MyMax7219 import MyMatrix
from random import randint
import time

matrix = MyMatrix()

matrix.showMessage('MOIN')

for i in range(9):
    matrix.letter(str(9 - i))
    time.sleep(0.2)

matrix.clear()
time.sleep(0.2)

for i in range(8):
    for j in range(8):
        matrix.pixel(j, i, 1)
        time.sleep(0.02)
    time.sleep(0.1)

for i in range(0, 250, 20):
    matrix.brightness(i)
    time.sleep(0.2)

matrix.clear()
time.sleep(0.2)

abc = [
    'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
    'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'