Pages: [1]   Go Down
Author Topic: easyVR vs sim900 shild  (Read 462 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ?     
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 617
Posts: 49463
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

USA, FL
Offline Offline
God Member
*****
Karma: 14
Posts: 689
A life? Where can I download one of those?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
#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:
void setup(){
Serial.begin(9600);
Serial1.begin(11200);
Serial2.begin(8400);
Serial3.begin(87600);
}

void loop(){
.....
}
Logged

//LiNK

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

USA, FL
Offline Offline
God Member
*****
Karma: 14
Posts: 689
A life? Where can I download one of those?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

//LiNK

Pages: [1]   Go Up
Jump to: