pause()

Description

Pauses a currently rotating servo. Note that the servo will still be generating power after being paused. Do not manually rotate it, as this may damage the servo. To resume the paused servo, call resume().

Syntax

servo.pause()

Parameters

servo: A variable of type AIServo.

Postback

None

Example

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

#include <AIServo86.h>

  

AIServoPort(ROBOTIS, AX12) bus;

AIServo myservo;

  

void setup()

{

  bus.begin(Serial3, 1000000);

  myservo.attach(bus, 3);

  myservo.write(150);  // Rotate the servo to the 150-degree position

  delay(600);

}

  

void loop()

{

  myservo.setPosition(280, 3000); // Set the servo's target angle: 280 degrees, time: 3 seconds

  myservo.run();

  delay(1000);

  myservo.pause(); // Pause the servo

  delay(1000); // Pause 1 Seconds

  myservo.resume(); //The servo resumes rotation

  delay(3000);

}

See also

- attach()
- setPosition()
- resume()


Library Reference Home

The text in the 86Duino reference is adapted from the Arduino reference and is licensed under the Creative Commons Attribution-Share Alike 3.0 License. The code examples in the reference materials have been released into the public domain.