Hello everybody
I posted on this forum recently but I ran into another problem and figured it needed its own thread.
(https://forum.pjrc.com/threads/61755-TEENSY-4-0-reading-wrong-data-on-GY-521-MPU6050-Breakout-Board)
For the project I'm working on, I need to get pitch and roll data from an GY-521 IMU board. Once again, my code compiles nicely on an Arduino but once I switch over to Teensy it doesn't work. The pitch and roll values do not accurately represent what they are supposed to like how it is on an arduino. I tried experimenting with int16_t because that's what did the trick last time (and I have my suspicions that it's a similar issue) but I could not get it to give the correct values.
So what's happening is that the pitch and roll slowly increases but as soon as it hits 1, the values shoot up when I'm moving the IMU at a relatively constant rate.
Could someone explain how to successfully port over Arduino code to Teensy so that I do not run into this issue again?
My code is attached below. Please help, and thanks in advance!
View attachment main.cpp
I posted on this forum recently but I ran into another problem and figured it needed its own thread.
(https://forum.pjrc.com/threads/61755-TEENSY-4-0-reading-wrong-data-on-GY-521-MPU6050-Breakout-Board)
For the project I'm working on, I need to get pitch and roll data from an GY-521 IMU board. Once again, my code compiles nicely on an Arduino but once I switch over to Teensy it doesn't work. The pitch and roll values do not accurately represent what they are supposed to like how it is on an arduino. I tried experimenting with int16_t because that's what did the trick last time (and I have my suspicions that it's a similar issue) but I could not get it to give the correct values.
So what's happening is that the pitch and roll slowly increases but as soon as it hits 1, the values shoot up when I'm moving the IMU at a relatively constant rate.
Could someone explain how to successfully port over Arduino code to Teensy so that I do not run into this issue again?
My code is attached below. Please help, and thanks in advance!
View attachment main.cpp