예제 #1
0
class AnimArrow:
    def __init__(self):
        self.display = Display(7, 7)
        self.display.fill(HSVColor(0.7, 1.0, 0.4))

    def paint(self, display: Display, bg_hue: float):
        display.copy_region_from(self.display)
예제 #2
0
        for pixel in self.pixels:
            display.set_pixel(pixel[1], pixel[2], HSVColor(pixel[0], 1.0, 1.0))
            pixel[0] += 0.002
            if pixel[0] > 1.0:
                pixel[0] = 0.0

            if abs(pixel[0] - bg_hue) < 0.01:
                pixel[0] = bg_hue + 0.03
                pixel[1] = random.randint(0, 7)
                pixel[2] = random.randint(0, 7)

        self.frame += 1


class AnimArrow:
    def __init__(self):
        self.display = Display(7, 7)
        self.display.fill(HSVColor(0.7, 1.0, 0.4))

    def paint(self, display: Display, bg_hue: float):
        display.copy_region_from(self.display)


animation = AnimTwo()

while True:
    d.fill(Color.convert(hsv))
    animation.paint(d, hsv.hue)
    d.update()
    hsv.h += 0.001
예제 #3
0
import sys
sys.path.append('..')

from random import randint

from ledwall.components import (SerialSender, Display, Color)

#s = UDPSender(server='192.168.178.96')
s = SerialSender(port_name='/dev/ttyACM0')

d = Display(10, 10, s, framerate=10)

while True:
    color = Color(randint(0, 255), randint(0, 255), randint(0, 255))
    d.fill(color)
    for i in range(11):
        white = Color(randint(0, 255), randint(0, 255), randint(0, 255))
        d.set_pixel(randint(0, d.columns), randint(0, d.rows), white)
    d.update()
예제 #4
0
import sys
sys.path.append('..')

from ledwall.components import (SerialSender, HSVColor, Display)

#s = UDPSender(server='192.168.178.96')
s = SerialSender(port_name='/dev/ttyACM0')

d = Display(10,10,s, framerate=30)

color = HSVColor(0.,1.,1.)

while True:
	for i in range(360):
		color._h = i / 360.
		d.fill(color,True)

예제 #5
0
from ledwall.components import (Display, UDPSender, HSVColor)
from ledwall.games.tetris import Tetris

display = Display(7,7,UDPSender(server='192.168.178.96'))
game = Tetris(display)

bg = HSVColor(0.0,1.0,0.4)
hueDelta = 0.01

while True:
	display.fill(bg)
	game.drawPiece(game.get_new_piece())
	display.update()
	bg._h += hueDelta