Arduino2Max Problems

I'm still stuck getting Analog Write to work. If I use the 'serial out' part of the patch in isolation it works with Arduino and I can use a Max slider to fade an LED. I believe the example tutorial is called Dimmer. I am essentially trying to integrate this into my project.

I have a sensor that feeds data in to Max from the Arduino this data then needs to be transmitted back to the Arduino in a feedback loop so I can modulate the voltage coming from the sensor (I will run PWM through a LPF to convert to analog voltage once I have it working properly). So I need to use Analog Write on PWM outs. But this isn't working. I have an LED attached to pin 9 then to ground and it is not dimming.

Can someone please help me with the code, I have no idea what I'm doing! :~

:grin: