I’m currently working on a project, which involves reading sensor data from a MPU6050 used with an Arduino Uno.
We recently switched to OF and Firmata. Before that I used the “normal” Arduino IDE without Firmata and everything worked out.
As I found some great examples on how to use analog and digital inputs with OF & Firmata, I am quite lost when it comes to I2C.
Does anyone has an example on how to implement the communication? I went through the ofArdunio class methods but couldn’t really find a proper documentation, or maybe I just totally overlooked it. I tried using some of the methods but didn’t get far.
I would really appreciate your help.
Greetings
Georg
Hi,
I’ve no experience with firmata, however, I found this in the ofArduino.cpp file:
I think those i2c functions will do the job?
Good luck
Edit: now I read that you already tried some of these methods without much luck, and are looking for an example. So my answer will be a bit too undetailed I’m afraid.
Correct me if I am wrong, but it could not be slower the cycle time (fps) of an OF app vs the Arduino itself?
Some time ago I used ofxSerial to an Arduino Mega and then I communicated to/from an ESP8266 controller (using Aruino IDE) using i2c and it worked fine.
You can use OSC through USB too with this addon. (There’s another new one from @bakercp too: https://github.com/bakercp/ofxOscSerial)
Also, related to MPU6050, there’s some boards that makes some (hardware accelerated) filtering/signal cleaning of sensors, faster than what you can do inside OF (if I am not wrong)