I am working on an artificial horizon project using a TFT display (ST7735), an MPU6050 and an Arduino Nano/Teensy3.5.
I have a really odd problem: when I wire everything up to the Arduino Nano, the MPU6050 gives genuine accurate data and the artificial horizon shows up nicely on the TFT display. Because of the slow 16MHz clock speed on the nano, I get a lot of flickering on the screen as it updates a few times each second.
So, I switched to a much faster Teensy 3.5, but now the MPU6050 gives super weird data on the artificial horizon.
If I leave it for a while the values eventually stabilize in roll (though 180deg rotated), but the pitch is
constantly changing in a random seeming manner.
I went back to the raw data read sketch I was using previously (with the arduino nano) to get the angles off the MPU 6050, and found that I was successfully connecting to the MPU6050 but the serial monitor was left hanging on waiting for first interrupt… Why would this be?
I thought this might be a problem with the fact that the teensy 3.5 accepts 5v but prefers 3.3v logic, so I got a bidirectional voltage converter to solve this.
But, to my dismay, it did nothing.
Any help is appreciated and maybe this is a common problem that I have somehow missed…
Attached are my wiring chart, the MPU6050 raw data read that works with the nano & teensy (jeff rowberg’s code) and the artificial horizon code that works with the nano but not the teensy (this is an adapted version of Stanislav Trofimov’s code).
SuccessfulDataRead.ino (15.7 KB)
Thomas_AHI.zip (8.55 KB)