Professional Documents
Culture Documents
h>
#include <LiquidCrystal.h>
float percentg=0;
void setup() {
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.setCursor(0, 1);
lcd.print("SPEED CONTROLL");
delay(2000);
lcd.clear();
void loop() {
potValue = analogRead(A0); // reads the value of the potentiometer (value between 0 and 1023)
potValue = map(potValue, 0, 1023, 0, 180); // scale it to use it with the servo library (value between 0
and 180)
lcd.setCursor(0, 0);
lcd.setCursor(4, 1);
lcd.print(" ");
lcd.setCursor(6, 1);
lcd.print(percentg);
delay(1000);