Hello everybody!
I'm using the arduino 33 nano ble for keyword spotting purpose, so i loaded the micro_speech example on it and it works well. Now i'd like to send a message through the serial1 to an arduino mkrfox 1200 when the ble recognizes the keyword "yes", in order to make the mkrfox to send a message to the sigfox network only in this case. I connected the rx, tx and gnd pins on the boards, and i wrote in the sketch some lines to enable the serial1 communication, but it doesn't work.
I setted the nano ble as the trasmitter and the mkrfox as the receiver.
In the nano ble sketch i initialized the serial1 with
Serial1.begin();
then, for the transmission, i wrote this
Serial1.println("yes");
In the mkrfox sketch i wrote this to read the serial1
void loop()
{
// print the string when a newline arrives:
if (stringComplete) {
Serial.println(inputString);
// clear the string:
inputString = "";
stringComplete = false;
}
....
}
void serialEvent() {
while (Serial1.available()) {
// get the new byte:
char stringa = (char)Serial1.read();
// add it to the inputString:
inputString += stringa;
// if the incoming character is a newline, set a flag so the main loop can
// do something about it:
if (stringa == '\n') {
stringComplete = true;
}
}
}
I can't figure out what's wrong.
Thanks in advance for the help