I want to connect a GPS and BlueSnurf to "arduino Duemilanove" at the same time.so, can I connect the gps to RX(pin 0) and TX(pin1) and connect the BlueSmirf to pin2 and pin3 and configure them as TX,RX ? is that possible ? if it isn't possible,is there another way that will make this possible ?
have a look at the newSoftSerial library : http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1233298805/0
so,I configure new Tx,Rx on pin 3 and 4 for example ?
something like that :
#define GPS_RxPin 0 #define GPS_TxPin 1 #define BlueSmirf_RxPin 3 #define BlueSmirf_TxPin 4 NewSoftSerial nss(GPS_RxPin,GPS_TxPin); NewSoftSerial nss2(BlueSmirf_RxPin,BlueSmirf_TxPin);
then I will assign baud rate for both and start communicating with them ? I hope that is possible. This is my first day using arduino.
Pins 0 and 1 are connected to the hardware serial, if you want to use softserial you need to pick other pins
ok,I can use Software serial for the BlueSmirf and hardware serial for the GPS but Do you have a link that explains how to use hardware serial in Arduino ?
hanoush, Serial.begin() - Arduino Reference
Thanks but I thought Serial.***() is used with USB connection.
how will I use it for the USB and pin 0 and 1 ?
Yo cant use the USB serial and the RX / TX on pin 0 and 1 at the same time.
The USB serial is actually directly connected to pins 0 and 1.
So unless you can guarantee 100 % that the device connected to pins 1 and 0 will NEVER communicate at the same time as the PC on the USB port it won't work.
You can run more than one instance of the softserial though.
Thanks a lot,so I can use pin 2,3 for GPS, Pin 4,5 for BlueSmirf and USB for debugging them.
How is this going, hanoush? Yes, you can do this if you are careful about using the NewSoftSerial objects sequentially and not simultaneously.