Hi A380,
Thanks for your reply. The motor driver i'm using is GD02 version 1.0, different from the 1 in your picture. The power adapter connected to the motor driver supplies DC voltage of 12V with 2A current.
The LED on the servo motor does light up for just 1 second when it is initially powered up.
The example code i used is to factory reset the servo.
/*
This example shows how to do factory reset on G15. It will reset your G15
to default ID (0x01) and baudrate (19200 bps). If succeed, G15 LED will blink,
else LED on CT UNO will blink. Note: Please connect one servo at a time.
Function:
factoryReset(G15_ID); // Do factory reset to the selected ID
Product page:
Cytron G15 Shield:
http://www.cytron.com.my/p-shield-g15 G15 Cube Servo:
http://www.cytron.com.my/p-g15 CT-UNO:
http://www.cytron.com.my/p-ct-unoOriginal written by:
Ing Hui, Cytron Technologies
Modified:
26/01/16 Idris, Cytron Technologies
*/
#include <SoftwareSerial.h>
#include <Cytron_G15Shield.h>
Cytron_G15Shield g15(2, 3, 8); // SoftwareSerial: Rx, Tx and Control pin
//Cytron_G15Shield g15(8); // HardwareSerial: Control pin
#define DEFAULT_ID 0x01
#define BROADCAST 0xFE
#define LED 13
word error = 0;
byte data[10];
int baudrateMode = 0;
void setup()
{
pinMode(LED, OUTPUT);
Serial.begin(19200); //added myself
}
void loop()
{
switch(baudrateMode)
{
case 0:
g15.begin(1200);
break;
case 1:
g15.begin(2400);
break;
case 2:
g15.begin(4800);
break;
case 3:
g15.begin(9600);
break;
case 4:
g15.begin(19200);
break;
case 5:
g15.begin(38400);
break;
case 6:
g15.begin(57600);
break;
case 7:
g15.begin(115200);
break;
default:
break;
}
g15.factoryReset(BROADCAST);
delay(100);
error = g15.ping(BROADCAST, data);
if(error == 0 || error == 0x0400) // Ignore ID mistmatch since broadcast ID is used to ping the servo
{
if(data[0] == DEFAULT_ID) // Success
{
g15.setBaudRate(DEFAULT_ID, 19200); // Change to default baudrate
delay(100);
g15.end();
delay(100);
g15.begin(19200);
delay(100);
while(1)
{
g15.setLED(DEFAULT_ID, ON);
delay(500);
g15.setLED(DEFAULT_ID, OFF);
delay(500);
}
}
else // Fail, new ID is different
{
g15.end();
if(baudrateMode < 8) {
baudrateMode++;
}
else {
while(1)
{
digitalWrite(LED, LOW);
delay(1000);
digitalWrite(LED, HIGH);
delay(1000);
}
}
}
}
else // Fail, other error occur
{
g15.end();
if(baudrateMode < 8) {
baudrateMode++;
}
else {
while(1)
{
digitalWrite(LED, LOW);
delay(200);
digitalWrite(LED, HIGH);
delay(200);
Serial.print(error); // added myself
Serial.print(" "); //added myself
}
}
}
delay(100);
}
-----------------------------------------------------------------------------------------------------------------------------
I've added the commend 'Serial.print(error); ' in the bottom most 'else' case to perhaps display the error information on the serial monitor and i got this '3584' number.
After the code is fetched into the Arduino, the LED on the servo motor doesn't light up even once.
*color wire connection
- red ------- 3.3V
- black ---- Ground
- orange --- CTRL <--> pin 8
- white ----- Tx <--> pin 3
- brown ----- Rx <--> pin 2