I want to read out data from a MPU6500 accelerometer and gyroscope. But I get weird output in my serial monitor looking this:
14:03:39.560 -> ⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮ ⸮⸮⸮⸮⸮⸮@⸮⸮⸮⸮@⸮⸮⸮R⸮⸮⸮⸮⸮⸮
Can someone help me to get this to normal values?
My code is an example code from Arduino and MPU6500 6-axis Motion Tracking device - Arduino Learning and looks like this:
#include "Wire.h"
#include "I2Cdev.h"
#include "MPU6050.h"
MPU6050 accelgyro;
int16_t ax, ay, az;
int16_t gx, gy, gz;
#define LED_PIN 13
bool blinkState = false;
void setup() {
Wire.begin();
Serial.begin(38400);
Serial.println("Initializing I2C devices...");
accelgyro.initialize();
Serial.println("Testing device connections...");
Serial.println(accelgyro.testConnection() ? "MPU6050 connection successful" : "MPU6050 connection failed");
pinMode(LED_PIN, OUTPUT);
}
void loop() {
accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
Serial.print("a/g:\t");
Serial.print(ax); Serial.print("\t");
Serial.print(ay); Serial.print("\t");
Serial.print(az); Serial.print("\t");
Serial.print(gx); Serial.print("\t");
Serial.print(gy); Serial.print("\t");
Serial.println(gz);
blinkState = !blinkState;
digitalWrite(LED_PIN, blinkState);
delay(500);
}