// update 5/3/19 - for wave tank WITHOUT constServo now #include //this includes the servo library in your script Servo myservo; //intializing the servo as the variable "myservo" int pos = 0; //the position variable that changes int back = 0; // this sets the return position for the servo int forward = 60; // this sets the max position the servo rotates tp (60 degrees) void setup() { Serial.begin(9600); //monitor the movement myservo.attach(9); //attaches the servo on pin 9 myservo.write(back); //initializes to the servo's home position (0 degrees) } void loop() { for (pos = back; pos <= forward; pos += 1) { myservo.write(pos); delay(15); // change this if you want shorter or longer waves Serial.print(pos); } for (pos = forward; pos >= back; pos -=1) { myservo.write(pos); delay(15); // change this if you want shorter or longer waves Serial.print(pos); } }