Need Help with MPU6050 Please

Hello ,
Im a little hobbyist and ive tryed to build a lifting support for my Camper. i use a Controllino and connected 2 MPU6050 as balance system. ive also have a little UI that can lift or lower the Camper on left, Right, Top and bottom. Now i have the problem that each funktion (for mpu and for UI) work on its own but if i try to use em together the Serial monitor Crash after few trys and i must Reset the Controllino. Did anyone have a clou why this happend? i guess that my UI interrupts the MPU while it Request data but im not sure, ive tryed to write a Non-Blocking Methode but it dont Work… could anyone Help me pls

Thanks and Greetings

Papa_project.ino (13.7 KB)

@Genrof

Your "whoops" topic has been deleted

Thank you very much ^^
did you have any clue for my problem?

Extra Note: ive meanwhile could exclude some of the reasons. At the End the waitForCommand() methode doesnt work propperly and i dont know why, its basically just a Serial.available that wait for specific Strings, if i just let the waitForCommand() and use it to turn On/off some LEDs the programm doesnt run smoothlie and the Commandstring() did often get lost, i could see on the buildin LED that the Arduino received something but it doesnt process it.

P.S. All String Sendet with a # at the start and the end like: #LeHoON#\n, #VoRuON#\n etc

Now ive write 2 programms that run for itself. first one communicate with the UI and everything worked, the 2nd one get the MPU values and calculate the into Angles,. both programms run at itself but if i merge them together my code dont runn smoothly and much Strings of the UI get just lost

Communication_ard_test.ino (9.47 KB)

GetMPUData.ino (6.66 KB)

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.