예제 #1
0
    def message(self, text):
        self._text += text
        fixed_text = self._text

        # limit text to lcd's dimensions (lines and columns)
        lines = self._text.split("\n")
        del lines[self._lines:]
        lines = [line[0:self._columns] for line in lines]
        fixed_text = "\n".join(lines)

        app = TkCircuit()
        app.update_lcds(self._pins, fixed_text)
예제 #2
0
    def message(self, text):
        text_with_special_characters = ""
        for character in text:
            if character != "\n":
                code = ord(character)
                code = code % 255
                character = chr(code)

                if code <= 31 or (code >= 128 and code <= 161):
                    character = " "

            text_with_special_characters += character

        self._text += text_with_special_characters
        fixed_text = self._text

        # limit text to lcd's dimensions (lines and columns)
        lines = self._text.split("\n")
        del lines[self._lines:]
        lines = [line[0:self._columns] for line in lines]
        fixed_text = "\n".join(lines)

        app = TkCircuit()
        app.update_lcds(self._pins, fixed_text)
예제 #3
0
    def clear(self):
        self._text = ""

        app = TkCircuit()
        app.update_lcds(self._pins, self._text)
예제 #4
0
        "x": 200,
        "y": 40,
        "name": "speaker_en",
        "pin": 25
    }],
    "buttons": [
        {
            "x": 50,
            "y": 130,
            "name": "Press to toggle LED 2",
            "pin": 18
        },
    ]
}

circuit = TkCircuit(configuration)

isPlaying = False
fileIndex = 0

# Configuration files

CONFIG_FILENAME = '.billy.conf'

CONFIG_DEFAULT_MEDIA_DIR = 'media'
CONFIG_DEFAULT_DELAY = -0.75
CONFIG_DEFAULT_PLAY_ON_START = False


def refreshConfig(config):
    try: