With Halocode's microphone and built-in Wi-Fi, we can make a simple speech recognition application. The internet enables Halocode to use Microsoft's speech recognition service. You need to sign in/up to mBlock 5 to connect your Halocode to the internet.
Sign in to mBlock 5
Halocode needs to connect to the internet to use online speech recognition service. We need to sign in to mBlock 5 first.
Toggle on Upload mode
Click to toggle on Upload mode.
Connect to the internet
1. Drag an Events blockand a Wi-Fi block . Input the Wi-Fi name and password.
2. We want to know when the Wi-Fi is successfully connected. Add a Control block, a Wi-Fi block , and a Lighting block .
When the button is pressed, Halocode will start speech recognition and all LEDs will light up white. The recognition process lasts for 3 seconds. When it's done, all LEDs will go off as a signal.
3. Add an Events blockand a Lighting block . Change the color to white. Then add a Wi-Fi block .
4. Add a Lighting blockto light off all LEDs after the speech recognition is done.
5. Add a Control blockand an Operators block . Add Wi-Fi block to the first box and input "red" to the second box.
6. If the speech recognition result contains "red", all LEDs will light red, and go off in 1 second. Add these blocks:, , and .
7. Click "Upload" to upload the program to Halocode.
8. Wait until all the LEDs light up green. Then press the button and say "red". Check the LEDs of Halocode.