This article shows you how to drive a hobby servo using Odroid U3.

Upload this to your Arduino board:

 * rosserial Servo Control Example
 * This sketch demonstrates the control of hobby R/C servos
 * using ROS and the arduiono
 * For the full tutorial write up, visit
 * For more information on the Arduino Servo Library
 * Checkout :

#if (ARDUINO >= 100)
 #include <Arduino.h>
 #include <WProgram.h>

#include <Servo.h> 
#include <ros.h>
#include <std_msgs/Float32.h>

ros::NodeHandle  nh;

Servo servo;

void servo_cb( const std_msgs::Float32& cmd_msg){
  servo.write(*180); //set servo angle, should be from 0-180  
  digitalWrite(13, HIGH-digitalRead(13));  //toggle led  

ros::Subscriber<std_msgs::Float32> sub("servo", servo_cb);

void setup(){
  pinMode(13, OUTPUT);


  servo.attach(3); //attach it to pin 9

void loop(){

In the terminal of Odroid U3:


Open another terminal:

rosrun rosserial_python /dev/ttyACM0

Open another terminal:

rostopic pub servo std_msgs/Float32 <angle>

<angle> here can be any float number from 0 to 180.