Sonntag, 8. März 2015

Lab 4 - Servos

Servo motor controlled by PMW from Arduino

 

  1. The delay is added in order for the servo to move at a slower speed. Before i is incremented or decremented by 1, the loop will pause for 45 milliseconds resulting in a slower speed of the servo.
  2. It would b:
                         for(int i = 0; i <=45; i++){
                              toyServo.write(i);
                              delay(Servopause);
                          };

                         for(int i = 45; i >=0; i--){
                              toyServo.write(i);
                              delay(Servopause);
                          };
     3. It is because tone() and servo.attach() use the same timer. Thus, the two components are
         conflicting in their operations.


Servo motor controlled by potentiometer and Arduino




Servo motor controlled by a pushbutton momentary switch