Exemplo n.º 1
0
def start():
    def func(x):
        return [
            (255, 0),
            (0, 0),
            (255, 33),
            (7, 0),
        ][x]
    dev = Sgm7Game(func, 4)
    MainGame(dev).run_game()
Exemplo n.º 2
0
def start():
    def func_on():
        return (1, 0)

    def func_off():
        return (0, 0)

    def func_pulse():
        return (1, 1)

    dev1 = LedGame(func_on, 'on')
    dev2 = LedGame(func_off, 'off')
    dev3 = LedGame(func_pulse, 'pulse')
    dev = CompositeGame([dev1, dev2, dev3])
    MainGame(dev).run_game()
Exemplo n.º 3
0
def start():
    def func(i):
        return (i > 1, i > 2)

    dev = LedRowGame(func, disp_size=4, labels=['x', 'y', 'z'])
    MainGame(dev).run_game()
Exemplo n.º 4
0
def start():
    def char_func(x, y):
        return chr(ord('a') + x + y)

    lcd = LcdGame(char_func, (11, 4))
    MainGame(lcd).run_game()