#include Servo botservo; Servo midservo; Servo topservo; int botpos; int botpin = 0; int midpos; int midpin = 1; int toppos; int toppin = 2; int pause = 15; void setup() { botservo.attach(9); midservo.attach(10); topservo.attach(11); } void loop(){ int botval = analogRead(botpin); botval = map(botval, 0, 1023, 0, 180); if (botpos != botval && botpos < botval) { botpos = botpos ++; botservo.write(botpos); delay(pause); } else if (botpos > botval) { botpos = botpos --; botservo.write(botpos); delay(pause); } int midval = analogRead(midpin); midval = map(midval, 0, 1023, 0, 180); if (midpos != midval && midpos < midval) { midpos = midpos ++; midservo.write(midpos); delay(pause); } else if (midpos > midval) { midpos = midpos --; midservo.write(midpos); delay(pause); } int topval = analogRead(toppin); topval = map(topval, 0, 1023, 0, 180); if (toppos != topval && toppos < topval) { toppos = toppos ++; topservo.write(toppos); delay(pause); } else if (toppos > topval) { toppos = toppos --; topservo.write(toppos); delay(pause); } }