#include <Servo.h>
#include <LiquidCrystal_I2C.h>
Servo myservo;
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
myservo.attach(11);
lcd.begin(16, 2);
lcd.backlight();
}
void loop() {
lcd.clear();
lcd.print(" Clockwise");
lcd.setCursor(0,1);
lcd.print(" Rotation");
for (int pos = 0; pos <= 180; pos++) {
myservo.write(pos);
delay(10);
}
lcd.clear();
lcd.print("Anti - Clockwise");
lcd.setCursor(0,1);
lcd.print(" Rotation");
for (int pos = 180; pos >= 0; pos--) {
myservo.write(pos);
delay(10);
}
}