Created
February 2, 2014 08:00
-
-
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
This file contains hidden or 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
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