Go Down

Topic: easyVR vs sim900 shild (Read 537 times) previous topic - next topic

igor123

hi in my project I use
sim900 that works on Serial.begin(19200);   
and
easyVR that works on Serial.begin(9600);

so one of them doesn't working when the other is
how can I solve that problem ?   

igor123

OK
I solved that one
you just need to write AT+IPR = [your port]

but now i have a different problem
it's not working when i writelike that:
  Serial.begin(9600);
  port.begin(9600);
   mySerial.begin(9600);   

is it becouse they on the same port ?

PaulS

You apparently mistook this forum for snippets-r-us.com. They are down the internet a ways. Here, we get to see ALL of your code, posted using the # icon above.

codlink

igor123, you were told to use different Serial ports in a different thread.  You can only use 1 Serial port per device.  And how you call the ports  depends on what Arduino board you have. 

Uno only has one Serial port = HardwareSerial is pins(0,1)  You can't change these pins as it's hardware dependent.  So if you need another port you need the Software Serial Library.  You need to call the SoftwareSerial by: SoftwareSerial mySerial(2, 3).   Did you notice it was using different pins?

Code: [Select]

#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3);

void setup(){
mySerial.begin(4800); //Software Serial port
Serial.begin(57600); //Hardware Serial port
}

void loop(){
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());
}



Arduino Mega has 4 Hardware Serial ports.  So you can call them individually. 

Code: [Select]

void setup(){
Serial.begin(9600);
Serial1.begin(11200);
Serial2.begin(8400);
Serial3.begin(87600);
}

void loop(){
.....
}
//LiNK

igor123

thank, I understand that

but i still want to work on the uno with two ports
so I found that for this I need to use
portNAME.listen(); it's not very comfrtuble. .
but I didn't found another way
I have the mega ADK board too but it's not working with the sim900 shild
if you have a sagestions I will be glad to hear

codlink

See my reply for making a second port on the UNO with the SoftwareSerial library.  This library comes with the IDE and there are examples for how to use it.
//LiNK

Go Up