The QBO mouth is a 5 X 4 led matrix. I found a website that lets you select the led pattern and it gives you the hexidecimal value. There are two small issues:
- The rows are in reverse order. So row four of the website is equal to row one of the QBO led matrix.
- The website returns a value something like 000000001b1f0e04 and you will have to replace leading zeros with 0x. So the website value will be 000000001b1f0e04 and you will have to change it to 0x1b1f0e04.
Both of these issues are minor. I just thought that I would mention them since this post is for beginners.
https://xantorohara.github.io/led-matrix-editor/
Using the website editor you can select your pattern and use the value returned with QboCmd.py SetMouth function.
Here is some sample code so you can play with it:
import time
import serial #handles the serial ports
import QboCmd #holds some commands we can use for Qbo
#set up ports for communicating with servos
port = '/dev/serial0'
ser = serial.Serial(port, baudrate=115200, bytesize = serial.EIGHTBITS, stopbits = serial.STOPBITS_ONE, parity = serial.PARITY_NONE, rtscts = False, dsrdtr =False, timeout = 0)
QBO = QboCmd.Controller(ser)
print("all")
#ALL LEDs value from website 000000001f1f1f1f remember replace leading zeros with 0x
QBO.SetMouth(0x1f1f1f1f)
#Pause
time.sleep(1)
print("oval")
#oval value from website 000000000e11110e remember replace leading zeros with 0x
QBO.SetMouth(0xe11110e)
#Pause
time.sleep(1)
print("smile")
#smile -value from website 00000000110e0000 remember replace leading zeros with 0x
QBO.SetMouth(0x110e0000)
#Pause
time.sleep(1)
print("sad")
#sad value from website 00000000000e1100 remember replace leading zeros with 0x
QBO.SetMouth(0x0e1100)
#Pause
time.sleep(1)
print("serious")
#serious website value 00000000001f1f00 remember replace leading zeros with 0x
QBO.SetMouth(0x1f1f00)
#Pause
time.sleep(1)
print("love")
#love wesite value 000000001b1f0e04 remember replace leading zeros with 0x
QBO.SetMouth(0x1b1f0e04)
I leave attached two programs for the QBO mouth test: one for the syllables and one for the numbers, you can run them from the default QBO directory.