Wow, saw video to this code in action with >200fps on 2.4" OLED display. The display dimension was same as for the Lolin OLED (128x64). I wanted to try, but had no MPU6050 at hand here in secondary living place. So I just deleted all MPU calls, added missing variable definitions and fixed OLED pin numbers, see small diff below. I awaited to see a fixed view display, but to my surprise a complete 3D movie got displayed with >300fps! Maximum reported was 334fps:
4
As always I had problems with focus of my Android phone camera, but you get the idea on how this looks.
Here is a 8s 720p youtube video I took:
Hermann.
$ diff Rotatey_Balls.ino sketch_oct12a/sketch_oct12a.ino
8c8
< #include "mpu6050rotatey.h" /* Source http://tocknlab.hatenablog.com/entry/2017/03/11/182703 */
---
> float angleX,angleY,angleZ,lastAngleX,lastAngleY,lastAngleZ;
18,19c18,19
< int sdaPin = 21;
< int sclPin = 22;
---
> int sdaPin = 5;
> int sclPin = 4;
164,165d163
< mpu_init(sdaPin, sclPin);// sda, scl
< mpu_calibrate();
168d165
< calcRotation(); // read from MPU
186d182
< calcRotation(); // read from MPU
374a371
>
$