Hello,
I was wondering how I can program the movi shield (using the code format below) to send power to PWM pins when I say a command. I will be using this concept to power relays as described in my example below.
For example:
When I say: "Code red"
I want the Movi Shield to send power to pin 10 so I can activated a relay. The relay will then act as a switch and send power to another ardunio and that ardunio will execute its code.
When I say "At ease"
I want the Movi shield to send power to pin 10 and deactivate the relay.
(I will be using a: Keyestudio Single 5V Relay Module Compatible with Arduino UNO R3 MEGA)
Thanks in advance.
The Movi shield code format I use:
#include
MOVI recognizer (true); //Get a MOVI object, true enables serial monitor interface, rx and tx for alternate communication pins on AVR architecture boards
void setup() {
recognizer.init();
recognizer.callSign(F(“Baxter”)); //Train callsign (may take 20 seconds)
recognizer.addSentence(F(“How are you”)); //1
recognizer.addSentence(F(“Who are you”)); //2
recognizer.addSentence(F(“Run system check”)); //3
recognizer.addSentence(F(“Goodbye”)); //4
recognizer.addSentence(F(“Are you a robot”)); //5
recognizer.addSentence(F(“Run diagnostics”)); //6 (Be sure to update the response every time)
recognizer.train();
}
void loop() {
int res = recognizer.poll();
if (res == 1) {
recognizer.say(“I am doing just well”);
recognizer.ask();
}
if (res == 2) {
recognizer.say(“I am a Life Model Decoy created by Paglia Industries on August 13 2018”);
}
if (res == 3) {
recognizer.say(“Systems operating at full capacity”);
}
if (res ==4) {
recognizer.say(“Goodbye”);
}
if (res ==5) {
recognizer.say(“Pish posh”);
}
if (res ==6) {
recognizer.say(“There is 67% of program storage space and 70% of dynamic memory avaliable”);
}
}