Train TJBot to Play A Game of Say The Color in Node-RED

JeanCarl Bisson
2 min readAug 26, 2017

--

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.

--

--

JeanCarl Bisson
JeanCarl Bisson

Written by JeanCarl Bisson

I’m an IBM Technical Innovation Lead. I love to build prototypes and then share how I designed and built what I made so others can try it too.