sterretje:
In that case you need to place the sensor reading also in the in the stopped state and your basically are back where you started
Actually, having the sensor run the whole time doesn't seem to be a problem. (Phew) It looked like that was hanging things up, but once I changed the sensor code to run without delays it's been working fine.