#include <LiquidCrystal.h>
LiquidCrystal lcd(PA0, PA1, PA2, PA3, PA4, PA5);
float POT_RV;
float VOLTAGE;
void setup()
{
Serial.begin(9600);
lcd.begin(20, 4);
lcd.clear();
lcd.setCursor(3, 1);
Serial.println("STM32 BLUEPILL WITH LCD");
lcd.print("STM32 BLUE PILL");
lcd.setCursor(5, 2);
lcd.print("WITH LCD");
delay(2000);
lcd.clear();
lcd.setCursor(3, 1);
lcd.print("Voltage= ");
}
void loop()
{
POT_RV = analogRead(PB1);
VOLTAGE = ((POT_RV * 5)/4095);
Serial.println(VOLTAGE);
delay(500);
lcd.setCursor(12, 1);
lcd.print(VOLTAGE);
}