Skip to content

Instantly share code, notes, and snippets.

@randrews
Created February 2, 2014 08:00
Show Gist options
  • Save randrews/8764490 to your computer and use it in GitHub Desktop.
Save randrews/8764490 to your computer and use it in GitHub Desktop.
Read a FULL / NONE signal from an RC airplane receiver, and control an IO pin with it
void setup(){
pinMode(4, OUTPUT);
pinMode(5, INPUT);
Serial.begin(9600);
}
void loop(){
int length = pulseIn(5, HIGH);
Serial.println(length);
if(length < 1500) digitalWrite(4, LOW); // range is about 1000-2000 microseconds
else digitalWrite(4, HIGH);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment