resume()

Description

Resume a paused servo, allowing it to continue rotating toward the target angle.

Syntax

servo.resume()

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(100);

}

  

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()
- pause()


Library Reference Home

Text in the 86Duino reference material is adapted from the Arduino reference material 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.