Sorry .
My code is here : the sample DFRobot give as a sample
#include <SPI.h>
#include <ServoCds55.h>
#include "pins_arduino.h"
ServoCds55 myservo;
void setup (void)
{
 Serial.begin (115200);
 digitalWrite(SS, HIGH);Â
 SPI.begin ();
 SPI.setClockDivider(SPI_CLOCK_DIV8);
}
void loop (void)
{
 if(Serial.available()){
  char val = Serial.read();
  if(val != -1)
  {
   switch(val)
   {
   case 'p':
    myservo.write(1,300);//ID:1 Pos:300 velocity:150
    delay(3000);
    myservo.write(1,0);//ID:1 Pos:0 velocity:150Â
    break;
   case 'v':
    myservo.setVelocity(100);// set velocity to 100(range:0-300) in Servo mode
    break;Â
   case 'm':
    myservo.rotate(1,150);// CCW  ID:1 Velocity: 150 middle velocity 300 maxÂ
    delay(2000);
    myservo.rotate(1,-150);// CW  ID:1 Velocity: -150 middle velocity -300 max  Â
    break;Â
//Â Â case 'i':
//Â Â Â myservo.SetID(1,2);//ID:1Â newID:2
//Â Â Â break;
//Â Â Â Â
//Â Â case 'r':
//Â Â Â myservo.Reset(2);//Restore ID2 servo to factory Settings ( ID:1Â Baud rate:1000000)
//Â Â Â break;
 Â
   }
  }Â
  elseÂ
   Serial.println("Wait");
  delay(500);
 }
}
On the Mega, the SS pin is D53, as I mentioned in your other post. You must modify the ServoCds55 library to use D10, or jumper D10 on the shield to D53 on the Mega.
SurferTim:
On the Mega, the SS pin is D53, as I mentioned in your other post. You must modify the ServoCds55 library to use D10, or jumper D10 on the shield to D53 on the Mega.
Ok ^^ I got it ! So nice. Can you reply to my main post this solution ? So i can mark it as an answer :D:D:D
So happy.
It's a pity DFRobot forget to explain we have to change the SS pin for an arduino MEGA.
Especially for a beginner like me on arduino, little bit hard to understand
Today i just buy an "Arduino UNO" , because i tried to use the "smart servo controller" with a "Arduino MEGA" but never work.
And still not working .. I think maybe is not because of the code but how i plug the battery and components .
So i plan come back on the Arduino forum to find help
I just want to know why i can't make work my Servo Motor on this "Shield" .
I tried to implement the "example" basic code find on the webSite here.
Of course i already downloaded and imported with succes the library "ServoCds55 Library" at this link :
Hi @SurferTim . Thank you , always answer so quickly
Yes sorry , of course i plug USB cable from my laptop to the UNO . I just remove for take the picture.
But still not work ..
Really crazy ^^
You think is ok the battery i use ? Because i can see the battery is 3800 mAh . And the Maximum Currents for the servo is: 900mA
Mhh ok, i got it.
No unfortunatly , i can only try with this servo "Dynamixel AX-12A" because i only have this servo at home.
So that mean , is not the battery problem.
Do you use the same code as me ? with "Dynamixel AX-12A" Servo ?
Mhh ok it's a pity. I think is totaly different because i use "Smart Servo" on a specific shield for control this type of servo.
I hope somebody already meet the same problem as mine =(
Someone may be using that servo with that shield. Don't give up!
But in the mean time, check to insure the connector on the servo is the same polarity as the shield. Some servos have the power and ground wires reversed.
ok thank's a lot !!
But this shield is especially made for work with "Dynamixel AX-12" servo series. So i guess the connector on the servo is the same polarity as the shield.
But i will check for to be sure
This is a nice question ^^ I already think about too.
But the problem is i don't know how to get the ID of my servo .. Where can i find which ID is assigned to my servo ?
But i know by defaut normally , all "Dynamixel Servo AX-12" are set to number [ 1 ] .
If you think you may have changed it, you may need to poll each id and see if the servo works. It seems the "id change" example sketches like to change the id to 2. A for loop may be handy.
for(byte servoID = 1; servoID < 255; servoID++) {
 Serial.print("Servo id: ");
 Serial.println(servoID);
 // do your movement stuff here using servoID as the id, and see if it moves
}