Costello:
that does sound like what I'm after. I had a look at the sweep example and I can see how it would be helpful for speed control. but what kind of command would make the arduino check the pressure after eCh increment ?
Something like:
if(analogRead(sensorPin)<450)
break;
The "break" statement will cancel the rest of a FOR or WHILE loop. The loop variable will be left set to the last value used.
int position:
void closeClaw() {
int i;
for (i = position; i < 180; i++) {
servoClaw.write(180);
if(analogRead(sensorPin)<450)
break;
}
position = i;
}