Hello,
My project is to create a tiltmeter/inclinometer. I have the following hardwares:
-Adafruit OLED 128x64 i2c // with Adafruit_GFX.h and Adafruit_SSD1306.h
-Keyestudio Mega
-MPU6050 // MPU6050_6Axis_MotionApps20.h
I sorted out the core of the measuring device but the display is not want to do what I wish.
I would like to show the 3 running angle value like this:
| X: 23,2° |
| Y: 15,4° |
Z: 40,6° |
---|
I tried to change this example code to not use the serial but use the display instead. |
#ifdef OUTPUT_READABLE_YAWPITCHROLL
// display Euler angles in degrees
mpu.dmpGetQuaternion(&q, fifoBuffer);
mpu.dmpGetGravity(&gravity, &q);
mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);
Serial.print("ypr\t");
Serial.print(ypr[0] * 180/M_PI);
Serial.print("\t");
Serial.print(ypr[1] * 180/M_PI);
Serial.print("\t");
Serial.println(ypr[2] * 180/M_PI);
#endif
I do not show my code here because it not works at all. The characters are overlap each other, and some of them remained permanently on screen. The numbers need to be readable so I think I need a delay(500); between screen updates.
I have another problem with the screen. I want to monitor the initialization process on the following way:
Display...
(delay(2000)
Display...OK
SD card...
(SD card init routine)
SD card...OK (/NOK)
Gyro...
(Gyro init routine)
Gyro...OK (/NOK)
I want to "Something..." remains on screen and just the OK/NOK status appear next to it when the routine is done.
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0, 0);
display.println("Display...");
display.display();
delay(2000);
display.println("Display...OK"); // Until there everything is fine
display.display();
display.setCursor(15, 0);
display.println("SD card..."); // The text is showing up in the first line (0, 0), and push down the "Display...OK" text with some pixels (not 15) and sometimes it shift a little right too.
What is the problem with these lines?
Thanks for the help!