Don't forget to up-vote the question or answer if you find it helpful! If it's your own question and you're very happy with an answer you can accept it as best answer.
Thanks for the information about how to communicate from Arduino to max/msp. I have had success with digital and analog input but now I want to send messages back out to Arduino
For instance, I have a counter object tracking the amount of time someone stands on a floor switch. I want to set off a piezo buzzer if the person stands there for a certain length of time. How would I program the patch to trigger a digital pin on the Arduino high or low?
How you could do it is by using the PWM of the digital pins on the Arduino. PMW means Pulse Width Modulation, and what happens is that it switches on and off very quickly. This way you can control the piezzo buzzer. The faster the pulse, the higher the pitch.
Check on your Arduino board which digital pins accept PWM. For now, let's say you use pin number 2.
Put the + (red) side of the piezzo into pin 2 (or the one you chose with PWM). And put the - (black) side on ground. Check this tutorial for a bit more details.
In the Max patch that talks to your Arduino (arduino_test.maxpat), the first section is called digital Pin mode, there you want to set the pin you chose on your Arduino to be set to PWM.
In the PWM section of the arduino_test patch, select pin number 2 from the [Umenu].
Set up your trigger that happens from the person standing on the floor switch to activate the slider for the PWM. Maybe connect the counter to the PWM slider so that the longer the person stands on the switch, the higher the value of the slider, and thus the pitch of the buzzer.
Does this work for you? Let me know if it doesn't. Good luck.
Please note: When commenting on someone's question or answer, you will not receive notification on follow up comments unless you are mentioned with @Username. So for Andrew Spitz, you only need to use @Andrew