I have pretty well exhausted everything I can to solve this problem.
I have a 9dof Razor and have tried to send data to every other make of Arduino Board there is and never get the proper info coming across.
I use this line to send the data
Serial.print((int(ToDeg(MAG_Heading))));
Using an Ftdi serial cable i can read that data fine on my computer.
I send that same data to any other Arduino capture it and then ask it to print and it is not correct.
Here is the capture and print code.
byte headingData[2];
int i, headingValue;
void loop()
{
//-------------------------------------------- this is all gps stuff. This is just the example code given from tiny gps library.
//----------------------------------------------I deleted the part of the code for the time and date. I did not want it.
i=0;
headingValue =0;
compassheading();
if (headingValue != 0)
{
Serial.println(headingValue);
}
}
void compassheading(){
i = 0;
while(Serial.available() && i < 2)
{
headingData[i] = Serial.read();
i++;
}
headingValue = (headingData[0]*256 + headingData[1]);
headinggps = headingValue / 10; // this is the heading of the compass
}
Anyhow am I missing something here?
Probably and i think i know what it is.
I have been using the Arduinos Uarts and am thinking i need to throw a Max232 into the mix.
I certainly hope not.
If so am just going to breakout the SPI on the Razor and communicate that way.
All I am trying to do at this stage is to read the compass from the razor and send that heading to another board.
As far as the razor working direct to the PC yes it does.
And so does the Arduino boards work properly connected direct to the PC. It only happens when I send data from one device to the other using the serial port that this happens.
Are you trying to use the Serial Monitor to "see" things, at the same time as you are trying to use the Ardunio's serial port to talk with Razor?
I prefer to use a separate port, via NewSoftSerial, to avoid clashes. Even if you aren't using Serial Monitor, the Arduino's main port is "busy" with programming from time to time.
More at...
Don't let the "Delphi" bits put you off... there are general principles implicit in the discussion.