Software > Software

servo_hold.hex for Arduino Uno

(1/1)

walkercreations:
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.

walkercreations:
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: ---
//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()
{
}
 

--- End code ---

I have also attached the file that I'm using to this post.

Navigation

[0] Message Index

Go to full version