Skip to content

Instantly share code, notes, and snippets.

@skynettw
Created January 3, 2018 01:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skynettw/b1466f41561546f2243841e73392b694 to your computer and use it in GitHub Desktop.
Save skynettw/b1466f41561546f2243841e73392b694 to your computer and use it in GitHub Desktop.
#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