Issues sending integers out serial port to arduino

Andrew Rinehart's icon

Hello,
My arduino is set up to receive plain integers to set the speed of a stepper motor. It operates as intended in arduino, using the serial monitor. ie. I input "100" and it turns. I input "300" and it turns faster etc.

I would like to be able to automate it's speed with the set tempo of ableton. I'm pretty sure this should be fairly basic, but I cannot get the serial object to output a number other than zero; effectively only setting the speed to zero. I noticed I only get an output when the number object updates, even though the serial is constantly receiving bangs, which I found a little odd, but for my purposes shouldn't matter.

I am using a metro to send bangs to my serial object, and inputing the tempo to my serial through a number object.

Stepper motor test sept 29.amxd
amxd 9.34 KB

Anyone know what I am missing?
Thanks

Source Audio's icon

as first you need to use atoi between int and serial object
and send carriage return or line feed so that arduino can parse the number.
No need to bang serial object if arduino is not sending anything back.

Max Patch
Copy patch and select New From Clipboard in Max.


Andrew Rinehart's icon

YES
Thank you so much. Got it working.