Arduino and Max For Live

Learn about building and using Max for Live devices.
Post Reply
mmmarki
Posts: 1
Joined: Mon May 30, 2022 5:32 pm

Arduino and Max For Live

Post by mmmarki » Mon May 30, 2022 5:39 pm

Hey everyone,

I'm new to programming Max for Live patches and I have not much experience how Max patches exactly work...

I have an Arduino Uno board with an MPU6050 sensor that can print out accelerometer and gyroscope X-Y-Z data and temperature data.

I want to create a Max for Live patch that can receive the data which is printed with Serial.print from the Arduino and use it to map it to parameters in Ableton.

I would use the Connection Kit, but it doesn't support the I2C Protocol, because it interferes with the StandardFirmata that is used (I think).

Any suggestion how this could be done? As mentioned I am brand new to Max, but here is the code used in the the Arduino IDE:

#include<Wire.h>
const int MPU = 0x68;
int16_t AcX, AcY, AcZ, Tmp, GyX, GyY, GyZ;

void setup() {
Wire.begin();
Wire.beginTransmission(MPU);
Wire.write(0x6B);
Wire.write(0);
Wire.endTransmission(true);
Serial.begin(9600);
}
void loop() {
Wire.beginTransmission(MPU);
Wire.write(0x3B);
Wire.endTransmission(false);
Wire.requestFrom(MPU, 12, true);
AcX = Wire.read() << 8 | Wire.read();
AcY = Wire.read() << 8 | Wire.read();
AcZ = Wire.read() << 8 | Wire.read();
Tmp = Wire.read() << 8 | Wire.read();
GyX = Wire.read() << 8 | Wire.read();
GyY = Wire.read() << 8 | Wire.read();
GyZ = Wire.read() << 8 | Wire.read();
Serial.print(AcX);
Serial.print(",");
Serial.print(AcY);
Serial.print(",");
Serial.println(AcZ);
delay(333);
}

Rivanni
Posts: 416
Joined: Sat Nov 26, 2016 12:30 pm

Re: Arduino and Max For Live

Post by Rivanni » Tue Jun 07, 2022 11:46 pm

You could learn something from this video, part 1 of a 2 part introduction to Arduino & Max.

Post Reply