Hallo, as I told I work with the Arduino Uno and the controller Board.
Now I want to Read out the Position:
Position = Dynamixel.readPosition(SERVO_ID);
But this do not work.
And what I also get not working a Serial Output over the serial monitor.
I always geht Chars from the Servo comands I think and between this I get some Serial Informations.
But if I use Serial Print the Servo do not move anymore:
#include <Dynamixel_Serial.h> // Library needed to control Dynamixal servo
int Temperature,Voltage,Position;
#define SERVO_ID 0x01 // ID of which we will set Dynamixel too
#define SERVO_ControlPin 0x10 // Control pin of buffer chip, NOTE: this does not matter becasue we are not using a half to full contorl buffer.
#define SERVO_SET_Baudrate 57600 // Baud rate speed which the Dynamixel will be set too (57600)
#define LED13 0x0D // Pin of Visual indication for runing "heart beat" using onboard LED
#define TX_DEALY 2000 // in uSec
#define CW_LIMIT_ANGLE 0x001 // lowest clockwise angle is 1, as when set to 0 it set servo to wheel mode
#define CCW_LIMIT_ANGLE 0xFFF // Highest anit-clockwise angle is 0XFFF, as when set to 0 it set servo to wheel mode
void setup(){
delay(1000); // Give time for Dynamixel to start on power-up
/*Dynamixel.setTempLimit(1,80); // Set Max Temperature to 80 Celcius
Dynamixel.setVoltageLimit(1,65,160); // Set Operating Voltage from 6.5v to 16v
Dynamixel.setMaxTorque(1,1023); // 50% of Torque
Dynamixel.setSRL(1,2); // Set the SRL to Return All
Dynamixel.setTempLimit(2,80); // Set Max Temperature to 80 Celcius
Dynamixel.setVoltageLimit(2,65,160); // Set Operating Voltage from 6.5v to 16v
Dynamixel.setMaxTorque(2,1023); // 50% of Torque
Dynamixel.setSRL(2,2); // Set the SRL to Return All
*/
Dynamixel.begin(SERVO_SET_Baudrate, SERVO_ControlPin, TX_DEALY); // We now need to set Ardiuno to the new Baudrate speed
Dynamixel.setMode(SERVO_ID, SERVO, CW_LIMIT_ANGLE, CCW_LIMIT_ANGLE); // set mode to SERVO and set angle limits
Serial.begin(9600); // Serial speed for PC
mySerial.println("Finish Servo");
//Dynamixel.setPID(Servo_ID, P_Gain, I_Gain, D_Gain)
}
void loop(){
Temperature = Dynamixel.readTemperature(SERVO_ID); // Request and Print the Temperature
Serial.print("AX2 *** Temperature: "); // Print the variables in the Serial Monitor
Serial.println(Temperature);
Position = Dynamixel.readPosition(SERVO_ID); // Request and Print the Posit
Serial.println(Position);
Dynamixel.ledState(SERVO_ID, OFF);
Dynamixel.servo(SERVO_ID,0,0x100); // Move servo to angle 1(0.088 degree) at speed 100
delay(1000);
Dynamixel.ledState(SERVO_ID, ON);
Dynamixel.servo(SERVO_ID,4000,0x3FF); // Move servo to max angle at max spe
delay(1000);
}
thx
druckgott