Created
November 21, 2016 13:51
Star
You must be signed in to star a gist
Arduino code that mimics an RF transmitter in order to program an ESC without one.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include <Servo.h> | |
static const int PROP_PIN = 9; | |
Servo brushless; | |
void setup() { | |
Serial.begin(9600); | |
brushless.attach(PROP_PIN); | |
brushless.writeMicroseconds(2000); | |
} | |
void loop() { | |
if(Serial.available()) { | |
byte message[1]; | |
Serial.readBytes(message, 1); | |
char msg = (char) *message; | |
if(msg == '0') { | |
brushless.writeMicroseconds(0); | |
Serial.println("MIN"); | |
} | |
else if (msg == '1'){ | |
brushless.writeMicroseconds(2000); | |
Serial.println("MAX"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment