#include<Servo.h>
#include<LiquidCrystal.h>
const int rs = PB0, en = PB1, d4 = PB10 , d5 = PB11 , d6 = PC13, d7 = PC14;
LiquidCrystal lcd(rs,en,d4,d5,d6,d7);
int servoPin = PA0;
int potPin = PA3;
Servo servo;
void setup()
{
lcd.begin(16,2);
lcd.setCursor(0,0);
lcd.print("CIRCUIT DIGEST");
lcd.setCursor(0,1);
lcd.print("SERVO WITH STM32");
delay(3000);
lcd.clear();
servo.attach(servoPin);
}
void loop()
{
lcd.clear();
int angle;
int reading;
reading = analogRead(potPin);
angle = (reading/24);
servo.write(angle);
lcd.setCursor(0,0);
lcd.print("ANGLE:");
lcd.print(angle);
delay(100);
}