Reading i2c from Arduino? Maxuino?

Oct 12, 2011 at 2:34am

Reading i2c from Arduino? Maxuino?

I’ve dug around a lot on the forum and elsewhere and haven’t had any luck. I’m trying to figure out how I might read and make sense of data from sensors that communicate w/ i2c.

Maxuino has been pretty solid for me, and on their page they say “This allows Max to read analog and digital pins, write to digital and PWM pins, control servos, listen to i2c sensors and much much more.”

Does anybody here have any experience or ideas for receiving and making sense of i2c sensors in Max?

Thanks in advance for any help.

#59264
Oct 12, 2011 at 5:21pm

In my experience all the i2c stuff is handled by the arduino (or other microcontroller), then you send the data to the computer via serialUSB, or whatever other options the computer and the arduino can speak. All of the i2C stuff I’ve used have used the “wire” library on the arduino.

#212996
Oct 12, 2011 at 8:43pm

Hmmm, so no Maxuino. I’ve seen some discussion of Firmata handling i2c, but apparently it doesn’t yet. Anybody else have anything helpful?

#212997
Oct 12, 2011 at 9:27pm

There are a number of resources on the Arduino website that explain how to interface i2c devices using the Wire library
http://arduino.cc/en/Reference/Wire
http://arduino.cc/en/Tutorial/SFRRangerReader

http://arduino.cc/en/Tutorial/DigitalPotentiometer

Additionally, there are several examples included with the Arduino IDE that deal with serial communication that contain Max5 patches (File>Examples>4.Communications).

#212998
Oct 12, 2011 at 11:07pm

I’m pretty sure the i2c stuff HAS to be handled by the Arduino as it’s a communication protocol in and of itself. I copy/pasted the code from this to get it going:

http://www.sparkfun.com/products/10530

Thankfully I have that magnetometer, but it gives you a good idea of what needs to happen.

(I found the arduino reference stuff REALLY confusing as it explains everything about wire/i2c, but in a non-practical way.)

#212999
Oct 13, 2011 at 2:57am

Thanks all for your suggestions. I was hoping to stay in Max because I’ll be teaching this to people with no coding experience. But maybe I can figure out how to make it simple.

#213000
Apr 24, 2012 at 3:33am

@nilloc

I’m in the same boat. I’m looking to teach a class and want to stay in Max and avoid a lot of hand coding w/ Arduino. I’ve also been using Maxuino for this purpose. I’d like to get them using gyro/magnetometer/accelerometer boards via i2c directly into Max. Did you have any luck figuring this out?

#213001
Apr 29, 2012 at 10:27pm

i’m exactly in the same situation. ( @lostboy )
any idea guys?

thanks guys

#213002
Apr 30, 2012 at 7:15am

Reading datas over IC2 with an arduino is quite straightforward but OT. Check the standard Wire.h library. Here is an example with the CMPS10 compass:

http://www.robot-electronics.co.uk/files/arduino_cmps10.ino

p

#213003
Apr 30, 2012 at 7:38am

I think they’re saying they don’t want to do it IN Arduino, but rather, in max/maxuino.

#213004
Apr 30, 2012 at 10:38am

yes guys,
i was talkin’ about doin’ it with maxuino.
but thanks for the info.
seems that i have to write the code in arduino to read all my analog and I2C sensors signals e use the serial object in max to read values.
Do you think is something complicated ?( given that i have some practice with c programming so the synthax seems very easy in arduino )
thanks
a.

#213005
Apr 30, 2012 at 1:48pm

It’s not (that) complicated, especially if you have pervious coding experience. My only coding was object oriented (max) when I got into Arduino, and I didn’t find it too hard to do.

I find using Maxuino to be real clunky either way. Much much easier if you just roll your own using serial object. (There’s a (seemingly buried?) tutorial on the c74 page for setting up an Arduino without needing Maxuino)).

#213006
Apr 30, 2012 at 4:56pm

There are also the Communication examples that come bundled with the Arduino software, which include Max5/6 patches.

#213007

You must be logged in to reply to this topic.