Programming a ESC . Need help please

Hi there.

I am truly new to this but I need some help on programming a ESC to work with my arduino. I cant get it to arm. The ESC I am using is a Hornet 60a. I am using it to test a skateboard out with a smartphone app. Could anybody help me out with the arduino sketch for this ESC. Infortunately I am a real noob at this. Do you know what would be the best app for this project?

Thanks so much to who ever can help me

/* Sweep
 by BARRAGAN <http://barraganstudio.com>
 This example code is in the public domain.

 modified 8 Nov 2013
 by Scott Fitzgerald
 http://www.arduino.cc/en/Tutorial/Sweep
*/

#include <Servo.h>

Servo myservo;  // create servo object to control a servo
// twelve servo objects can be created on most boards

int pos = 0;    // variable to store the servo position

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

void loop() {
  for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
    // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
}

Servo code works well with speed controllers.

Let us know if this works with your speed controller

Thank you so much will try. All i need to do is increase and decrease speed of motor with a android app that works with this code.

I can't get it to arm. The ESC I am using is a Hornet 60a.

Have you looked at the Hornet 60a manual to see how to arm it?

FLY YOUR HORNET ESC Your HORNET ESC comes ready to fly with Lithium Polymer type batteries. No settings changes are needed. To fly, turn your transmitter on before connecting your HORNET ESC to the motor battery. When you connect the motor battery to the HORNET ESC, you will hear an initialization tone from the motor and a series of beeps telling you how many Lithium Polymer cells in series are in your battery pack, and the servos will be active. Make sure that the number of beeps matches the number of cells in your pack. If it doesn't, make sure your pack is fully charged. The HORNET ESC will not arm unless you move your throttle stick to the lowest position. When the HORNET ESC receives the low throttle command, it will arm and play a double tone through the motor, indicating it is armed and now ready to run. If this is the first time you are running the controller, advance the throttle slowly to ensure that the rotor or propeller rotation is correct. If it isn't, swap any two of the motor side connections and it will then spin properly.

So use .write(0); or .writeMilliseconds(1000); to "move your throttle stick to the lowest position" and put in a delay long enough for the ESC to arm.