Razor 9DOF + GPS + arduino serial com with NewSoftSerial

Hello,

  I am trying to combine a Razor9dof, a GPS (ls20031) to an arduino (duemi).
I have configured the Razor with the ftdi cable. Works fine. Also connected to the arduino, on pin0, works fine. 
Here is the code:
void setup() {
  Serial.begin(57600);  
}

void loop() {
  if (Serial.available()) {
    Serial.print(Serial.read(), BYTE);
  }
}


However, using NewSoftSerial library doesnot work. I get lots of giberish as output.

My code is:
#include <NewSoftSerial.h>
NewSoftSerial nss (4,5);

void setup() {
  Serial.begin(115200);
  nss.begin(57600);
}

void loop() {
  if(nss.available()) {
    Serial.print(nss.read(),BYTE);
  }


I have the gps connected on pin2 and the razor on pin4. Using the above code (and changing pin 4,5 to 2,3); I get the nmea sentences alright.

Any ideas on why serial on pin0 works fine, but NewSoftSerial does not?

Regards,
Nicolas

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Hey,
    Can you show me how you build up the program further if you want to use for example the acceleration measuring? I don’t know how to do it.
    Thanks in advance
    Johan
  • new problem is with the gps; I don't get the whole sentences through newsoftserial. Through serial pin0, everything is fine.
    Is newsoftserial the way to go?
    Regards,
    Nico
  • ok, dropping the razor baud rate to 38400 made it work.
This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…