release()

Description

Releases a specified servo. Calling this function causes the servo to immediately stop outputting force. After releasing, the servo returns to the state it was in when attach() was called. You must set a target angle again and then call either run() or write() to start the servo rotating.

Syntax

servo.release()

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

#include <AIServo86.h>

 

AIServoPort(ROBOTIS, AX12) bus;

AIServo myservo;

 

void setup()

{

  bus.begin(Serial3, 1000000);

  myservo.attach(bus, 3);

  myservo.write(150);  // Turn the servo to 150 degrees

  delay(3000); // Delay for 3 seconds

  myservo.release(); // Release the servo

}

 

void loop() {}

See also

– attach()
– setPosition()
– pause()
– run()


Library Reference Home

The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.