Created
January 3, 2018 01:10
-
-
Save skynettw/b1466f41561546f2243841e73392b694 to your computer and use it in GitHub Desktop.
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 "Servo.h" | |
int value = 0; | |
Servo m; | |
void setup() { | |
m.attach(9); | |
Serial.begin(9600); | |
} | |
void loop() { | |
value = analogRead(A0); | |
if (value>0) { | |
Serial.println(value); | |
if (value>500) { | |
m.write(90); | |
delay(500); | |
m.write(180); | |
delay(500); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment