#include #include SoftwareSerial mySerial(0, 1); // RX, TX Servo servo; int analogPin = 7; int val = 0; int thresh = 550; void setup() { pinMode(7, INPUT); pinMode(8, OUTPUT); mySerial.begin(9600); } void loop() { val = analogRead(analogPin); mySerial.println(val); delay(100); if(val > thresh) { digitalWrite(8, HIGH); delayMicroseconds(100); digitalWrite(8, LOW); delayMicroseconds(100); } }