GUI examples

These examples have no simulation, they test only GUI.

LCD

from entrypoint2 import entrypoint
from pysimavrgui.lcdgame import LcdGame
from pysimavrgui.maingame import MainGame

@entrypoint
def start():
    def char_func(x,y):
        return chr(ord('a')+x+y)
    lcd = LcdGame(char_func,(11,4))
    MainGame(lcd).run_game()
$ python -m pysimavrgui.examples.gui.lcdgame_ex
_images/screenshot_id3.png

LED row

from entrypoint2 import entrypoint
from pysimavrgui.ledrowgame import LedRowGame
from pysimavrgui.maingame import MainGame

@entrypoint
def start():
    def func(i):
        return (i>1,i>2)
    dev = LedRowGame(func,disp_size=4,labels=['x','y','z'])
    MainGame(dev).run_game()
$ python -m pysimavrgui.examples.gui.ledrowgame_ex
_images/screenshot_id4.png

7 segment display

from entrypoint2 import entrypoint
from pysimavrgui.maingame import MainGame
from pysimavrgui.sgm7game import Sgm7Game


@entrypoint
def start():
    def func(x):
        return [
                (255,0),
                (0,0),
                (255,33),
                (7,0),
                ][x]
    dev = Sgm7Game(func,4)
    MainGame(dev).run_game()
$ python -m pysimavrgui.examples.gui.sgm7game_ex
_images/screenshot_id5.png

Text

from entrypoint2 import entrypoint
from pysimavrgui.compgame import CompositeGame
from pysimavrgui.maingame import MainGame
from pysimavrgui.textgame import TextGame

@entrypoint
def start():
    def func1():
        return 'hello'
    def func2():
        return 'hi'
    dev1 = TextGame(func1)
    dev2 = TextGame(func2)
    dev=CompositeGame([dev1,dev2],align=1)
    MainGame(dev).run_game()
$ python -m pysimavrgui.examples.gui.textgame_ex
_images/screenshot_id6.png

Table Of Contents

Previous topic

About

Next topic

Simulation examples

This Page