I need a little help with the following script. Basically what it is supposed to do is to get accelerometer information iPhone Sensor Stream to control a motor controller to go forwards when phone is tilted forwards, stop when tilted back to a resting position, and reverse when the phone is tilted backwards.
I have managed to get the motors going forwards at an accelerometer reading of 0.3000, and stop the motors at less than 0.2000. But when I add the code for going in reverse, the EZ-B disconnects. What I need is for the motors to stop between readings of less than 0.2000, and more than -0.2000. I suspect there is a conflict in the script below...
elseif($AccelerometerY <0.2000 >-0.2000)
Any ideas what I have done wrong (i suspect it's something to do with #Stop), and an idea of what the correct script should look like?