Train TJBot to Play A Game of Say The Color in Node-RED
Today we’ll train TJBot how to play a game where the player speaks the color of TJBot’s light.
TJBot picks a random color using the JavaScript function that has five colors.
This projects using the LED, the microphone, and the speaker. Enable those options in the TJBot configuration.
Add the Watson Text to Speech and Speech to Text service credentials.
Remember to set the Speaker Device ID to the card and device number of your speaker. Run the command aplay -l to locate this if you have a USB audio adapter or USB speaker connected.
Use two template nodes to construct the message that the player has spoken the correct color, or to try again.
The second example uses the Cough-male.wav file, which will play a male cough.
Here’s a video of how to train TJBot to play the game.
That’s it for today’s skill. What can you train TJBot to do now that it shine a light and have someone speak the color? This game is great for kids learning their colors.
Come back tomorrow and we’ll train TJBot to measure the CPU temperature.
This post is part of a series of skills you can train TJBot to perform.