Arduino2Max Problems

I don't really know, I just ripped that code out of the example that comes with Max2Arduino. I've barely used Arduino before. I have my sensor built and it is being read into Max just fine (cheers for the tip about inverting values though). I want to use Analog Write instead of the Digital Out stuff, to feed values back from the Max Patch back into the sensors.

Thanks, Jan