//Salman Taş 20191701044
#include <LiquidCrystal.h> //import tke library
LiquidCrystal lcd(7, 6, 12, 10, 9, 8);
void setup() {
// put your setup code here, to run once:
pinMode(A0, INPUT);
lcd.begin(16, 2);
}
void loop() {
// put your main code here, to run repeatedly:
long int a_in = analogRead(A0); // read the analog input
float V = a_in * (5.0 / 1023.0); //clip it between 0-5
lcd.print(V);
lcd.setCursor(0, 1);
float num_of_star = a_in * (16.0 / 1023.0); //clip it between 0-16
int num = int(num_of_star); // num of *
for (int i = 0; i < num; i++) {
lcd.print("*"); //print the * depends on the voltage
}
lcd.print(" "); //put space to to clear the lcd
lcd.setCursor(0, 0);
}