Dynamixel servo library wont even compile examples

Im trying to use an AX-18A servo with my arduino but even the example sketches with the library wont compile. I´ve tried both the AX-12A and ardyno library.

AX-12A library error Move example:

/var/folders/21/l9c_p4wn6c36lkxbf3pbh3c40000gp/T/arduino_modified_sketch_684879/Move.ino: In function 'void setup()':
Move:21:45: error: no matching function for call to 'AX12A::begin(long unsigned int, unsigned int, Serial_)'
ax12a.begin(BaudRate, DirectionPin, &Serial);
^
In file included from /var/folders/21/l9c_p4wn6c36lkxbf3pbh3c40000gp/T/arduino_modified_sketch_684879/Move.ino:6:0:
/Users/something/Documents/Arduino/libraries/AX-12A-servo-library/src/AX12A.h:153:7: note: candidate: void AX12A::begin(long int, unsigned char, HardwareSerial
)
void begin(long baud, unsigned char directionPin, HardwareSerial srl);
^~~~~
/Users/something/Documents/Arduino/libraries/AX-12A-servo-library/src/AX12A.h:153:7: note: no known conversion for argument 3 from 'Serial_
' to 'HardwareSerial*'
exit status 1
no matching function for call to 'AX12A::begin(long unsigned int, unsigned int, Serial_*)'

.
.
.

ardyno library example Joint mode:

joint_mode:14:44: error: no matching function for call to 'HardwareDynamixelInterface::HardwareDynamixelInterface(Serial_&)'
HardwareDynamixelInterface interface(Serial);
^
In file included from /Users/something/Documents/Arduino/libraries/ardyno/src/DynamixelInterface.h:62:0,
from /Users/something/Documents/Arduino/libraries/ardyno/src/DynamixelMotor.h:9,
from /Users/something/Documents/Arduino/libraries/ardyno/examples/joint_mode/joint_mode.ino:3:
/Users/something/Documents/Arduino/libraries/ardyno/src/DynamixelInterfaceArduinoImpl.h:80:2: note: candidate: HardwareDynamixelInterface::HardwareDynamixelInterface(HardwareSerial&, uint8_t)
HardwareDynamixelInterface(HardwareSerial &aSerial, uint8_t aDirectionPin=NO_DIR_PORT);
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/something/Documents/Arduino/libraries/ardyno/src/DynamixelInterfaceArduinoImpl.h:80:2: note: no known conversion for argument 1 from 'Serial_' to 'HardwareSerial&'
/Users/something/Documents/Arduino/libraries/ardyno/src/DynamixelInterfaceArduinoImpl.h:77:7: note: candidate: constexpr HardwareDynamixelInterface::HardwareDynamixelInterface(const HardwareDynamixelInterface&)
class HardwareDynamixelInterface:public DynamixelInterfaceImpl
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/something/Documents/Arduino/libraries/ardyno/src/DynamixelInterfaceArduinoImpl.h:77:7: note: no known conversion for argument 1 from 'Serial_' to 'const HardwareDynamixelInterface&'
exit status 1
no matching function for call to 'HardwareDynamixelInterface::HardwareDynamixelInterface(Serial_&)'

any ideas how to fix this?

Please post the sketch that produces those errors

AX-12A Library

/*
 * Example showing how to send position commands to AX-12A
 */

#include "Arduino.h"
#include <AX12A.h>

#define DirectionPin 	(10u)
#define BaudRate  		(1000000ul)
#define ID				(1u)

int initial_pos = 512;
int max = initial_pos + 100;
int min = initial_pos - 100;

int pos = initial_pos;
int delta = 5;

void setup()
{
	ax12a.begin(BaudRate, DirectionPin, &Serial);
}

void loop()
{
	pos = pos + delta;

	if (pos > max)
	{
		pos = max;
		delta *= -1;
	}

	if (pos < min)
	{
		pos = min;
		delta *= -1;
	}

	ax12a.move(ID, pos);
	delay(20);
}

ardyno library

// Test motor joint mode
#include "DynamixelMotor.h"

// id of the motor
const uint8_t id=1;
// speed, between 0 and 1023
int16_t speed=512;
// communication baudrate
const long unsigned int baudrate = 1000000;

// hardware serial without tristate buffer
// see blink_led example, and adapt to your configuration
HardwareDynamixelInterface interface(Serial);

DynamixelMotor motor(interface, id);

void setup()
{ 
  interface.begin(baudrate);
  delay(100);
  
  // check if we can communicate with the motor
  // if not, we turn the led on and stop here
  uint8_t status=motor.init();
  if(status!=DYN_STATUS_OK)
  {
    pinMode(LED_BUILTIN, OUTPUT);
    digitalWrite(LED_BUILTIN, HIGH);
    while(1);
  }

  motor.enableTorque();  

  // set to joint mode, with a 180° angle range
  // see robotis doc to compute angle values
  motor.jointMode(204, 820);
  motor.speed(speed);
}

void loop() 
{
  // go to middle position
  motor.goalPosition(512);
  delay(500);

  // move 45° CCW
  motor.goalPosition(666);
  delay(500);

  // go to middle position
  motor.goalPosition(512);
  delay(500);

  // move 45° CW
  motor.goalPosition(358);
  delay(500);
}

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

bump

anyone who can help?

"I'm trying to use an AX-18A servo with my arduino"

Which of the 2 dozen or so different Arduinos?

I have Uno, nano, micro and esp-32, but the problem is the IDE wont even compile when trying to verify the example sketches

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.