hi everyone…well i have trained my voice recognition module v3 for 3 purpose on and arduino uno.
But now i want to connect my v3 with a nano and transmit the instruction wirelessly using NRF24 to an uno to which is connected my relay. can anyone tell me how to proceed with the transmission of the instruction part?
this is my current code between v3 and uno
#include <SoftwareSerial.h>
#include "VoiceRecognitionV3.h"
/**
2 -------> TX
3 -------> RX
*/
VR myVR(2,3); // 2:RX 3:TX
uint8_t records[7]; // save record
uint8_t buf[64];
int led = 13;
int CH0 = 8;
int CH1 = 9;
#define onRecord (0)
#define offRecord (1)
#define leftRecord (2)
#define rightRecord (3)
#define upRecord (4)
#define downRecord (5)
void setup()
{
myVR.begin(9600);
pinMode(led, OUTPUT);
pinMode(CH0, OUTPUT);
pinMode(CH1, OUTPUT);
}
void loop()
{
int ret;
ret = myVR.recognize(buf, 50);
if(ret>0){
switch(buf[2]){
case onRecord:
digitalWrite(led, HIGH);
break;
case offRecord:
digitalWrite(led, LOW);
break;
case leftRecord:
digitalWrite(CH0, HIGH);
break;
case rightRecord:
digitalWrite(CH0, LOW);
break;
case upRecord:
digitalWrite(CH1, HIGH);
break;
case downRecord:
digitalWrite(CH1, LOW);
break;
}
}
}