Go Down

Topic: Serial Comm Issue (Read 404 times) previous topic - next topic

macman20

Hi, I'm working on a quadrotor project but seem to be having troubles with receiving serial communication on my Arduino.  I'm trying to communicate between my Arduino Pro and my Sparkfun 9DOF razor IMU running the a modified AHRS code.  I have my Arduino connected to an XBee on the hardware serial line communicating to my computer so I am using the new soft serial library for a second serial line. I have the TX and RX lines on the IMU hooked to pins 2 and 3 on the Arduino respectively. I also have the IMU board grounded to the Arduino and both boards are running from their own separate power sources. The problem I seem to be having is that I'm only getting the first 2-3 characters of correct data on the serial monitor  and the rest is gibberish.  I am sure that the IMU is reporting accurate data because I've hooked it directly to my computer and it transmits fine. I am also certain that the baud rate is correct on both devices (57600). I have a very simple program running just to test this:
Code: [Select]

#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);
void setup()  {
  Serial.begin(57600);
  mySerial.begin(57600);
}
void loop(){
  if(mySerial.available()){
    Serial.write(mySerial.read());
  }
}

Any suggestions?
Thanks!

johnwasser

Change "SoftwareSerial" to "NewSoftSerial".
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

macman20

I'm sorry, I don't know why I put SoftwareSerial in there I meant to put NewSoftSerial, I have NewSoftSerial in my code now and it still gives me the same results.

Go Up