#include Servo myservo1; int servo1 = 16; int read_high; int read_low; int diff; void setup() { pinMode(8,OUTPUT); SerialUSB.begin(0); myservo1.attach(servo1); myservo1.write(0); } void loop() { digitalWrite(8,HIGH); //Step the voltage high on conductor 1. read_high = analogRead(A2); //Measure response of conductor 2. delayMicroseconds(100); //Delay to reach steady state. digitalWrite(8,LOW); //Step the voltage to zero on conductor 1. read_low = analogRead(A2); //Measure response of conductor 2. diff = read_high - read_low; //desired answer is the difference between high and low. SerialUSB.println(diff); if (diff > 300) { SerialUSB.println("here"); myservo1.write(0); delay(1000); myservo1.write(180); delay(1000); } }