Hello! I have used this tutorial https://www.edgeimpulse.com/blog/voice- … d-microbit for the Micro:bit to create a voice recognition program for my microbit. I now want to make it so that the microbit controls a servo anytime someone says my keyword.
I have a Moto:bit board, and was wondering how/if I can use the c++ runtime ( https://lancaster-university.github.io/ … docs/ubit/ )to control a servo connected to the Moto:bit?
Code atm is this, which is of course showing a smiley face whenever the keyword is said. I want to replace this with the servo going one way for the keyword, and the other way for when it doesnt hear the keyword.
/**
- Invoked when we hear the keyword !
*/
static void heard_keyword() {
const char * happy_emoji ="\
000,255,000,255,000\n\
000,000,000,000,000\n\
255,000,000,000,255\n\
000,255,255,255,000\n\
000,000,000,000,000\n";
MicroBitImage img(happy_emoji);
uBit.display.print(img);
}
/**
- Invoked when we hear something else
*/
static void heard_other() {
const char * empty_emoji ="\
000,000,000,000,000\n\
000,000,000,000,000\n\
000,000,255,000,000\n\
000,000,000,000,000\n\
000,000,000,000,000\n";
MicroBitImage img(empty_emoji);
uBit.display.print(img);
Seems simple enough to change, but if someone could point me in the right direction that would be very helpful to me.
Using the Moto:bit would be great bc then I can use stronger servos without having to fiddle with power supplies etc.
Thanks!/J