Skip to content

lutecia16v/ServoRS304

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RS304 Controll library for Arduino

RS304 is Servo motor for hobby robot. It was developed by FUTABA. The servo mortor controlled by serial communication (Half-duplex communication). This library controll full function of the servo. Servo and Arduino connect using 3-state circuit.

Usage

Initialize library.

ServoController servoController(&Serial);
void setup() {
  servoController.begin(115200);
  delay(500);
}

Move sarvo and get current angle.

void loop() {
    SerialUSB.println("Start servo moving.");
    servoController.turnOnTorque(0x01);
    delay(1000);
    while(1){
        int angle = 0;
        SerialUSB.println("Loop");
        servoController.moveServo(0x01,300,100); //servoId, angle, speed
        delay(2000);
        angle = servoController.getCurrentAngle(0x01);
        SerialUSB.println(angle);
        delay(1000);
        servoController.moveServo(0x01,-300,100);
        delay(2000);
        angle = servoController.getCurrentAngle(0x01);
        SerialUSB.println(angle);
        delay(1000);
    }

}

Please show example folder.

License

  • Licensed under the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1

Author

Copyright © 2018 Masato Kawamura. All rights reserved.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 100.0%