Problems with Serial and M5StickC Plus

brkmrkt's icon

Dear Max users

After some years off with Max and Arduino I recently entered in a project with the M5StickC Plus and Max, developing a light sensor that should send me a stream of data to Max. I unfortunately ran into problems and wanted to ask if anybody would know what might be the problem?

I have a light sensor attached to the M5StickC Plus which is connected to my M1 Mac via USB-C. I upload the code with Arduino IDE (see code below) and in the Serial Monitor of the Arduino IDE I see the values of the light sensor streaming in.

The problem is, that I do not get any data into my Max Patch (attached). Does anybody know what might be the problem?

Any help or hint would be highly appreciated.
Best regards, Chris

------------
Code on the M5StickC Plus

----------------------------------
----------------------------------
#include <M5StickCPlus.h>

void setup() {

M5.begin();

pinMode(32, INPUT);

Serial2.begin(115200, SERIAL_8N1, 33);

}

uint16_t analogRead_value = 0;

void loop() {

analogRead_value = analogRead(33);

Serial.println(analogRead_value);

delay(50);

}

----------------------------------
----------------------------------

Serial Port 03.maxpat
Max Patch