Author Topic: servo_hold.hex for Arduino Uno  (Read 1688 times)

0 Members and 1 Guest are viewing this topic.

Offline walkercreationsTopic starter

  • Full Member
  • ***
  • Posts: 90
  • Helpful? 1
    • walkercreations
servo_hold.hex for Arduino Uno
« on: March 15, 2013, 08:56:48 PM »
I am just now experimenting with an Arduino Uno and would like to use the servo_hold.hex file from the $50 Robot tutorial. I'm not savvy enough yet to know what code to write for the Arduino and was wondering if someone could please help me in what I need to write or do to use the .hex file.
Peter Walker
Fruitland, MD USA

Offline walkercreationsTopic starter

  • Full Member
  • ***
  • Posts: 90
  • Helpful? 1
    • walkercreations
Re: servo_hold.hex for Arduino Uno
« Reply #1 on: March 16, 2013, 09:22:33 AM »
To answer my own question...

After doing some digging into the Arduino Language Reference, I came across exactly what I needed under the Servo Libraries section.

The following code is what is needed to send a 1500ms signal to the servo:

Code: [Select]

//Arduino Official Code - Perfect for centering the servo

#include <Servo.h>

Servo myservo;

void setup()
{
  myservo.attach(9);  //attaches the servo signal to pin 9
  myservo.writeMicroseconds(1500);  // set servo to mid-point
}

void loop()
{
}
 

I have also attached the file that I'm using to this post.
Peter Walker
Fruitland, MD USA

 


Get Your Ad Here