Skip to content

Instantly share code, notes, and snippets.

@yazinsai
Created May 6, 2016 09:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yazinsai/7f53c37ff9e8821fe79b867669a48010 to your computer and use it in GitHub Desktop.
Save yazinsai/7f53c37ff9e8821fe79b867669a48010 to your computer and use it in GitHub Desktop.
/*
Coded by Marjan Olesch
Sketch from Insctructables.com
Open source - do what you want with this code!
*/
#include <Servo.h>
int PIN_ESC = 9, value = 0;
Servo srvESC;
void setup() {
srvESC.attach(9);
Serial.begin(9600);
/* For HobbyKing ESC:
- Write '2000'
- Wait 4 beeps, then write '700'
- Wait a couple of beeps, then write '750'
- Now write desired speed, between '755 - 2000'
*/
}
void loop() {
//First connect your ESC WITHOUT Arming. Then Open Serial and follo Instructions
srvESC.writeMicroseconds(value);
if(Serial.available()) {
value = Serial.parseInt(); // Parse an Integer from Serial
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment