Communication between Arduino uno and FlyPort

Hi,

When I say "hello" to microphone to Voice Recognition in Arduino uno, Arduino then sends 'z' to other module. But how Arduino uno sends 'z' to other module? Below is my sending program.

if(reader== 'H') //hello { Serial.println(reader); flyport.print('z'); //send to flyport }

Is that correct? Thanks

Well. Since there is no reply, it seems do not understand my intentions.
I give u clear.
Below is my working program with Arduino uno.

#include <Servo.h>

#include <SoftwareSerial.h>

int i;
char reader;
SoftwareSerial easyvr(2, 3);

Servo servoMain3;

void setup()
{
servoMain3.attach(7);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
pinMode(9, OUTPUT);
Serial.begin(9600);
easyvr.begin(9600);
delay(1000);
easyvr.print(‘b’);
for(i=0; i<100; i++){
if(easyvr.read()==‘o’){
Serial.println(“awake”);
break;
}
delay(1);
}//for
easyvr.print(‘x’);
for(i=0; i<100; i++){
if(easyvr.read()==‘x’){
Serial.println(“x received”);
break;
}
delay(1);
}//for
easyvr.print(’ ');
for(i=0; i<100; i++){
if(easyvr.read()==‘A’){
Serial.println(“firmware good”);
break;
}
delay(1);
}//for
easyvr.print(‘l’);
easyvr.print(‘A’);
for(i=0; i<100; i++){
if(easyvr.read()==‘o’){
Serial.println(“language set”);
break;
}
delay(1);
}//for
easyvr.print(‘o’);
easyvr.print(‘A’);
for(i=0; i<100; i++){
if(easyvr.read()==‘o’){
Serial.println(“Infinite Timeout”);
break;
}
delay(1);
}//for
easyvr.print(‘i’);
easyvr.print(‘B’);
Serial.println(“trigger”);

}//setup
void loop()
{
reader = easyvr.read();
// Serial.println(reader);
if(reader==‘s’){
Serial.println(reader);
delay(100);
easyvr.print(’ ');
reset();
}//read
if(reader==‘H’){
Serial.println(reader);
servoMain3.write(0); //Hello
delay(1000);
servoMain3.write(90);
delay(1000);
}

if(reader==‘t’){
Serial.println(reader);
reset();}
if(reader==‘e’){
Serial.println(reader);
reset();}

}//loop

void reset(){
for(i=0; i<1000; i++){
reader = easyvr.read();
delay(1);
if(reader!=-1)
break;}
delay(100);
easyvr.print(‘i’);
easyvr.print(‘B’);
}

It is working with Arduino uno. Thus, I want to say “hello” to microphone to Voice Recognition in Arduino uno, Arduino then sends ‘z’ to other module. So, please help me change that program so that Arduino can send ‘z’ to other module.

Thanks.

Well. Since there is no reply, it seems do not understand my intentions.

7 below will help you get started. The bottom link has basic "sending" code.

http://forum.arduino.cc/index.php/topic,148850.0.html

http://forum.arduino.cc/index.php?topic=177857.msg1320406#msg1320406

Hi, Thanks for helping. I already researched alot but could not find any answer.

2nd link you posted - I don't understand that code because I don't see any program that can send message.

cloudystrife:
Hi, Thanks for helping. I already researched alot but could not find any answer.

Not enough, apparently, since you’ve ignored some of the instructions in the first link on how to post code…

hmm. you mean I have to insert code so that people can see?

cloudystrife:
hmm. you mean I have to insert code so that people can see?

You’ve already “inserted code”, you just didn’t do it properly.

What do I do? I am fairly new to arduino.

cloudystrife: What do I do?

Follow directions. Code should be posted using CODE tags, as is explained in the linked thread, and can be seen in just about any thread in these forums.

How to send 'z' to other module?

if(reader== 'H')                 //hello
    {               
      Serial.println(reader);
      flyport.print('z');            //send to flyport
    }

Is that correct?

cloudystrife: Is that correct?

Yes

Okay. Thanks! I am waiting for an answer. Erm do you know how to send 'z' to other module?

cloudystrife: Okay. Thanks! I am waiting for an answer. Erm do you know how to send 'z' to other module?

What "other module"?

Hi,

I think I have a problem with 3 begin(band rate). Below is my program.

Serial.begin(9600);
 easyVR.begin(9600);
 flyport.begin(9600);

is that correct?

Correct in what sense?

Your code snippet doesn't tell us much, nor have you stated what equipment you are using, what you are hoping will happen and what actually happens.

Read this before posting a programming question

Is this related to your other thread?

http://forum.arduino.cc/index.php?topic=178086.0

other module is Flyport.

[quote author=Nick Gammon link=topic=178064.msg1320527#msg1320527 date=1374128814] Is this related to your other thread?

http://forum.arduino.cc/index.php?topic=178086.0 [/quote]

No. This thread is about how to send 'z'. Other thread is about that arduino can allow 3 begin(band rate). I am new to arduino.

Sorry. I don know why its not working.

#include <Servo.h>

#include <SoftwareSerial.h>

int i;
 char reader;
 SoftwareSerial easyVR(2,3);// rx, tx for easyvr
 SoftwareSerial flyport(0,1);// rx, tx for flyport
 
 
void setup()
{

 Serial.begin(9600);
 easyVR.begin(9600);
 flyport.begin(9600);
 delay(1000);
easyVR.print('b');
for(i=0; i<100; i++){
if(easyVR.read()=='o'){
Serial.println("awake");
break;
   }
delay(1);
   }//for
easyVR.print('x');
for(i=0; i<100; i++){
if(easyVR.read()=='x'){
Serial.println("x received");
break;
   }
delay(1);
   }//for
 easyVR.print(' ');
for(i=0; i<100; i++){
if(easyVR.read()=='A'){
Serial.println("firmware good");
break;
   }
delay(1);
   }//for  
  easyVR.print('l');
  easyVR.print('A');
for(i=0; i<100; i++){
if(easyVR.read()=='o'){
Serial.println("language set");
break;
   }
delay(1);
   }//for  
  easyVR.print('o');
  easyVR.print('A');
for(i=0; i<100; i++){
if(easyVR.read()=='o'){
Serial.println("Infinite Timeout");
break;
   }
delay(1);
   }//for 
  easyVR.print('i');
  easyVR.print('B');
Serial.println("trigger");
  
}//setup
void loop()
{
    reader = easyVR.read();
   // Serial.println(reader);
    if(reader=='s')
    {
      Serial.println(reader);
      delay(100);
      easyVR.print(' '); 
      reset();
    }
    ////// put if code here
    
    if(reader== 'H')                 //hello
    {               
      Serial.println(reader);
      flyport.print("z");          //send to flyport
      
    }
    
   if(reader=='t')
   {
    Serial.println(reader);
    reset();
   }
   if(reader=='e')
   {
    Serial.println(reader);
    reset();
   }

}//loop
void reset(){
  for(i=0; i<1000; i++){
    reader = easyVR.read();
    delay(1);
if(reader!=-1)
break;}
 delay(100);
  easyVR.print('i');
  easyVR.print('B');
}

Is my code correct? Example: When I say “Hello” to Voice Recognition(EasyVR) in Arduino uno, Arduino then sends ‘z’ to other module(Flyport). After that, servo motor connected to FlyPort is moving. That is all.
Thus, is there anything wrong with my code?

Below is my working program with Arduino uno.

Which doesn't mention flyport.

      flyport.print('z');            //send to flyport

How about posting the code you are actually working on? Inside code tags.

Read this before posting a programming question

Please do not cross-post. This wastes time and resources as people attempt to answer your question on multiple threads.

Threads merged.

  • Moderator