Beispiel #1
0
#!/usr/bin/env python

import max7219.led as led
import max7219.canvas as canvas
import max7219.transitions as transitions
import time
from random import randrange

led.init()
led.show_message("Hello world!", transition = transitions.left_scroll)

for x in range(256):
    led.letter(x)
    time.sleep(0.1)

while True:
 #   for x in range(500):
 #       canvas.set_on(randrange(8), randrange(8))
 #       canvas.scroll(randrange(16))
 #       canvas.render()
 #       time.sleep(0.01)

 #   for x in range(500):
 #       canvas.set_off(randrange(8), randrange(8))
 #       canvas.scroll(randrange(16))
 #       canvas.render()
 #       time.sleep(0.01)

    for x in range(500):
        canvas.set_on(4, 4)
        canvas.scroll(randrange(8))
Beispiel #2
0
def end():
    led.letter(0x01)
    print('\nXau!')
    sleep(1)
    led.clear()
    exit(0)
Beispiel #3
0
#!/usr/bin/env python

import max7219.led as led
import max7219.canvas as canvas
import max7219.transitions as transitions
import time
from random import randrange

led.init()
led.show_message("Hello world!", transition=transitions.left_scroll)

for x in range(256):
    led.letter(x)
    time.sleep(0.1)

while True:
    #   for x in range(500):
    #       canvas.set_on(randrange(8), randrange(8))
    #       canvas.scroll(randrange(16))
    #       canvas.render()
    #       time.sleep(0.01)

    #   for x in range(500):
    #       canvas.set_off(randrange(8), randrange(8))
    #       canvas.scroll(randrange(16))
    #       canvas.render()
    #       time.sleep(0.01)

    for x in range(500):
        canvas.set_on(4, 4)
        canvas.scroll(randrange(8))
Beispiel #4
0
#!/usr/bin/env python2

import max7219.led as led
import max7219.transitions as transitions
from time import sleep

led.init()

def scroll():
    while True:
        text = raw_input('Escreva algo: ')
        led.show_message(text, transition = transitions.left_scroll)

try:
    scroll()

except KeyboardInterrupt:
    led.letter(0x01)
    print('\nXau!')
    sleep(1)
    led.clear()
    exit(0)