With all due respect, I'm not sure where you obtained those numbers from. The IMU board operates at 3.3V. Correct me if I'm wrong, but I don't think that's what defines the logic level.
In fact, I think the problem lies more in the code. After several attempts, I finally got good, readable data. However, it's still not what I need and I'm not sure where to go. Here's the output code from the IMU (just the very last output section; we're running at 9600 Baud):
Serial.println(TO_DEG(yaw)); //Serial.println();
Serial.println(TO_DEG(pitch)); //Serial.println();
Serial.println(TO_DEG(roll)); //Serial.println();
I can read it in it's entirety using the following code on the Uno:
String sensorData;
char c;
void setup() {
Serial.begin(9600);
Serial.println("9DOF Test");
}
void loop() {
while (Serial.available()) {
if (Serial.available() >0) {
c = Serial.read();
//sensorData += c; //adds c to the sensorData string
Serial.print(c); //see whatever came in on Serial.read()
}
}
if (sensorData.length() >0) {
Serial.println(sensorData); //output the string
readString=""; //resets reString for the next iteration of the loop
}
}
Since the IMU outputs using Serial.print, I can get a direct read out of the data from the IMU on the Uno. However, when I print out c from Serial.read() it gives me back the ENTIRE data stream instead of just one byte of it. Essentially, c and sensorData have the exact same data.
I want to be able to access each Euler angle (pitch, yaw, and, roll) independently as a number (int) so that I may use them to control actuators (servos, motors, etc.). I was thinking that if I could get each piece of data as an independent string, I could convert each one to a character array using .toCharArray() and then to an integer using atoi.
Any thoughts?