Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#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
You can’t perform that action at this time.