if( the_elevator_is_moving_up() && it_has_been_more_than_30ms_since_last_move()) {
pos++;
myServo.write(pos);
last_move = millis();
}
Simple. Now the servo moves slowly.
if( the_elevator_is_moving_up() && it_has_been_more_than_30ms_since_last_move()) {
pos++;
myServo.write(pos);
last_move = millis();
}
Simple. Now the servo moves slowly.
MorganS:
Simple. Now the servo moves slowly.
Yeah. But it should be in a little function and separate from the main code - I think I would call the function moveOneFloorSlowly()
...R