ChrisMB BTW - I'm studying with Fabio Morreale. :-)
of course
ChrisMB However I got an error code - 'couldn't create' - relating to the MPU6050
that would be because the built binary in that repo is probably an x86 and not ARM binary.
Besides that, this repo has two big problems: it relies on WiringPi and it runs I2C processing from within the audio thread. The former is mostly unsupported on Bela, the latter will cause audio glitches unless you run with a large enough block size. The good thing about the repo is that it contains most of the details of the I2C transactions needed to have the sensor work, so you don't have to dig through a datasheet or similar.
What I'd recommend instead is a mix of a C++ backend which sends and receives message from PureData and relays them over to the I2C device in a separate thread in order not to cause glitches. This is largely what has been done here, so I would refer you to that thread for a general explanation of the process. The final result were the C++ files you can find here
- one is a simple class that reads from the sensor
- the other is a modified version of Bela's standard C++ wrapper for Pd. The modifications needed here were minimal (search for "ENABLE_EVO" in the file).
In your case, the modifications to the render.cpp
should be very similar to the ones I already made there, while your equivalent to the Evo
class can draw largely from the register setting and reading that you see mpu6050
repo above. Overall it's only a handful of C++ lines that are needed, so hopefully it shouldn't be too complicated.