Close

Star of the Silver Screen

A project log for VoiceBox

Adding a Flask web interface (and other stuff) to the Google AIY Voice Kit.

tmTM 08/08/2018 at 15:500 Comments

I'm still tinkering with voice command processing for music playing and Blinkter patterns, so for now I'll just post a quickie on the Nokia 5110 display. (See "A Note on Wiring" for connection details - AND DON'T BLOW THE BACKLIGHT!)

For now, the top row of the display shows the Assistant status ("listening", "thinking" or "ready"), the next two rows show contextual information (date & time, song name, etc), and the last two rows show what the Assistant thinks you last said (handy for spotting when she interprets "pattern" as "patent").

def process_event(assistant, event):
...
    elif event.type == EventType.ON_RECOGNIZING_SPEECH_FINISHED and event.args:
...
        elif text == 'screen on':
            GPIO.output(BACKLIGHT, GPIO.LOW)
        elif text == 'screen off':
            GPIO.output(BACKLIGHT, GPIO.HIGH)

The code is almost identical to the code for controlling the cooling fan, and like the fan, the backlight can be controlled from the piHole GPIO page too. Note the logic is inverted  - GPIO.LOW is on. I think my previous 5110, with a different pinout, had a logic high backlight. Hard to say now as I blew it by connecting it to the 5V Driver3+ pin.

As I add more bells-and-whistles, I'm beginning  to find the 5110's 5 rows x 14 columns a bit too cozy. If I add a bigger screen, I'll probably move display handling to a separate process, so it can handle dynamic displays - like scrolling stock tickers - without making VoiceBox.py too messy.

Discussions