You are not logged in.

#2 Re: Microcontrollers & Computers » Arduino Uno projects » 2014-08-21 11:25:51

Salut Maxime,

So, how did it go ? Did you tried something ? Just let me know if you have questions.

#3 Learn robotics » Robotis OpenCM9.04-B - Getting started and Pan Tilt Demo » 2014-08-21 11:13:34

Replies: 1


These steps will help you getting started with the controller and the IDE.

All are useful to know for any Robotis projects.

-Robotis OpenCM 9.04B controller (Store link)
-2x AX-12A Robotis Smart Servos with 2x Robotis cables (Store link)
-Brackets; here I’m using CrustCrawler metal brackets (Store link)
-1x 12V/1A adapter (Store link)

Note: On the controller, I always put the switch to off when not using.

First thing to do is to download and install the Robotis OpenCM IDE software:

Link and installation (software, driver) tutorial:
http://support.robotis.com/en/software/ … pencm.htm/

Link to controller manual (Yeah, READ IT!):
http://support.robotis.com/en/product/c … m9.04.htm/

After that, you can test the controller with the IDE. To do that, upload the Blink example included in the IDE.

Now that you can blink the green light on the OpenCM 9.04B and having learned a bit about the IDE, let’s get some Dynamixels to work!

How to hook up brackets for Pan/Tilt:


5V USB is not enough power for the servos. You have to wire the two JST jacks to get power from the adapter. The one on the left is for a jumper and the other is for power. (See on pic and in manual for more info, left pin of each jack is negative). After, hook up the controller with USB to PC/Mac and then push the switch to the right to see red LEDS flash on the back of each Dynamixel. Yes, power!


Now with the IDE, you have to set the ID’s:
Take Dynamixel #1 and make sure the ID is set to 1;


Open IDE and upload:  File/Examples/Dynamixel Easy/a_getModelNumber

After upload, open the serial monitor, wait to see “Send any value to continue...” Then press any key. You will see if your Dynamixel #1 is really ID #1. Unplug Dynamixel #1 and plug the Dynamixel #2 on the controller.
Open IDE and upload:  File/Examples/Dynamixel Easy/a_getModelNumber


Open the setID code from here File/Examples/Dynamixel Easy/b_setID

In the IDE, go and change “NEW_ID 1” for “NEW_ID 2”
#define NEW_ID 1 //New ID to be changed.
Now looks like:
#define NEW_ID 2 //New ID to be changed.

Upload the edited example.

You can now wire the two Dynamixels together and after, upload the “a_getModelNumber” example again to see if each motors have the right IDs.

If all is good, mount all the pieces together, like this;


Finally, open the IDE and upload the code below:

/*  Dynamixel Pan/Tilt Demo
Pan/Tilt demo by Patrick Coutu based on code created 16 Nov 2012
/* Dynamixel ID defines */
#define ID_NUM_1  1
#define ID_NUM_2  2

/* Control table defines */
#define P_GOAL_POSITION    512
#define P_GOAL_SPEED    32

/********* Sync write data **************
 * ID1, DATA1, DATA2..., ID2, DATA1, DATA2,...
 /* Serial device defines for dxl bus */
#define DXL_BUS_SERIAL1 1  //Dynamixel on Serial1(USART1)  <-OpenCM9.04
#define DXL_BUS_SERIAL2 2  //Dynamixel on Serial2(USART2)  <-LN101,BT210
#define DXL_BUS_SERIAL3 3  //Dynamixel on Serial3(USART3)  <-OpenCM 485EXP

Dynamixel Dxl(DXL_BUS_SERIAL1);

word SyncPage1[9]=
  ID_NUM_1,200,50,  // 2 Dynamixels are move to position 0
  ID_NUM_2,800,50};  // with velocity 50
word SyncPage2[9]=
  ID_NUM_1,800,50, // 2 Dynamixels are move to position 512

void setup(){
// Dynamixel 2.0 Protocol -> 0: 9600, 1: 57600, 2: 115200, 3: 1Mbps 
  //Set all dynamixels as same condition.
  Dxl.writeWord( BROADCAST_ID, P_GOAL_POSITION, 512 );
  Dxl.writeWord( BROADCAST_ID, P_GOAL_SPEED, 512 );

void loop(){
 * byte syncWrite(byte start_addr, byte num_of_data, int *param, int array_length);

#4 Re: Introduce yourself » Autovortex Robotics » 2014-08-16 18:18:33

Hi autovortex,

Welcome to the Diigiit Robotics forum!

I'm the moderator. If you want to post about the association, the competition and include pictures, you can here, in the Robotic Events & organisations section. Thank you.

#5 Learn robotics » Servo + knob tutorial » 2014-08-08 10:57:49

Replies: 0

I had a servo sitting, doing nothing and wanted to do something with it!

I grabbed the servo, a 10k potentiometer, some wires and a breadboard.

Here I’m using an Arduino Uno R3 clone with a Motor Shield (same as Adafruit‘s Motor Shield).
The servo is a Parallax standard servo (any digital servo will do).


From 10k Pot to Arduino :
GND (black)    --> GND
Signal (yellow)--> A0
VCC (red)--> 5V

From Servo to Arduino:       
GND (black)--> GND
VCC (red)--> 5V
Signal (white)--> D10
or simply “Servo2” if using the motor shield (Servo2 signal pin = D10)


#include <Servo.h>

Servo myservo;  // create servo object to control a servo

int potpin = 0;  // analog pin used to connect the potentiometer
int val;    // variable to read the value from the analog pin

void setup()
  myservo.attach(10);  // attaches the servo on pin 10 to the servo object

void loop()
  val = analogRead(potpin);            // reads the value of the potentiometer
  val = map(val, 0, 1023, 0, 180);     // scale it to use it with the servo
  myservo.write(val);                  // sets position to the scaled value
  delay(15);                           // waits for the servo to get there

Turn the pot to see the servo moving !

#6 Re: Diigiit Robotics News » Welcome Patrick, our new Diigiit Robotics moderator » 2014-07-19 15:42:07

Thank you Diigiit for making me a moderator !

To all users:

Feel free to ask any questions about robotics, electronics in general, store products... anything. I'm here to help you !

As said, I constantly make all kinds of electronic projects during my free time and have experience with many kinds of controllers, computers, components and materials.


#7 Programming » Free book about ROS » 2014-07-17 11:12:38

Replies: 2

I found a free book about getting started with ROS, very useful.

Covers the latest distribution : Hydro.

It's called "A Gentle Introduction to ROS" by Jason M. O'Kane

Free to download here:


#8 Re: Microcontrollers & Computers » Arduino Uno projects » 2014-07-11 10:49:30

To Maxime and all,

Here is what I recently tried with an Arduino UNO, a servo motor and one LDR (light-dependent resistor), it worked well !

What you need:

  • 1 Servo

  • 1 Photocell (LDR)

  • 1 1.8kΩ Resistor

  • Arduino Uno

  • Protoboard

  • Some wires

From Arduino to breadboard; plug 5V to red rail and GND to blue rail...
Hook up servo and LDR to Arduino and power to breadboard:
Servo: Red to 5V, Black to GND on breadboard and yellow to PIN 9 on Arduino.
LDR: One pin to 5v and the other pin of the LDR to 1.8k resistor and hook to PIN A0 (analog 0 on Arduino) it has to be on same line of breadboard. Then plug the other end of the resistor (the 1.8k resistor) to GND.

Here is a working code:

#include <Servo.h>

Servo myservo;        // Create a servo instance
int pos = 0;          // Initial position of the servo
const int ldr = A0;    // Photocell pin
int val = 0;          // Light value

void setup(){
   myservo.attach(9);       // Attaches the servo on pin 9 to the servo object
   pinMode(ldr, INPUT);     // Initialize the photocell pin as an input
   Serial.begin(9600);      // Initialize serial communication (To see the values)

void loop(){
   val = analogRead(ldr);             // Read the value directly from the Arduino
   val = map(val, 0, 255, 0, 100);    // Map the values from 0 - 100
   Serial.println(val);               // Prints the values in the serial monitor
      case 100:
         myservo.write(0);            // Remains in 0°
      case 50:
         myservo.write(65);           // Moves to 65°
      case 10:
         myservo.write(160);          // Moves to 160°
      case 0:
         myservo.write(180);          // Moves to 180°

Have fun !

Board footer