Advertisement
Guest User

Untitled

a guest
Feb 1st, 2017
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.87 KB | None | 0 0
  1. /*
  2. Coded by Marjan Olesch
  3. Sketch from Insctructables.com
  4. Open source - do what you want with this code!
  5. */
  6. #include <Servo.h>
  7.  
  8.  
  9. int value = 0; // set values you need to zero
  10. int fst =1;
  11. Servo firstESC, secondESC; //Create as much as Servoobject you want. You can controll 2 or more Servos at the same time
  12.  
  13. void setup() {
  14.  
  15.   firstESC.attach(9);    // attached to pin 9 I just do this with 1 Servo
  16.   Serial.begin(9600);    // start serial at 9600 baud
  17.  
  18. }
  19.  
  20. void loop() {
  21.  
  22. //First connect your ESC WITHOUT Arming. Then Open Serial and follo Instructions
  23.   Serial.println(value);
  24.  
  25.   //firstESC.writeMicroseconds(850);
  26.   //firstESC.writeMicroseconds(950);
  27.   //firstESC.writeMicroseconds(1150);
  28.   //firstESC.writeMicroseconds(850);
  29.   if(Serial.available())
  30.    value = Serial.parseInt();    // Parse an Integer from Serial
  31.   firstESC.writeMicroseconds(value);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement