Pages: [1]   Go Down
Author Topic: Serial Comm Issue  (Read 388 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
#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!
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8940
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Change "SoftwareSerial" to "NewSoftSerial".
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

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

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

Pages: [1]   Go Up
Jump to: