here you go...
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int sensorPin = A0; // select the input pin for the potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor
#define pot_time_display;
void setup() {
lcd.begin(16, 2); // set up the LCD's number of columns and rows:
lcd.setCursor(4, 0); // Set the cursor to Column 4, Row 0
lcd.print("Welcome"); // Print "Welcome"
lcd.setCursor(0,1); // Set the cursor to Column 0, Row 1
lcd.print("Auto FollowFocus"); // Print "Auto Follow Focus"
delay(4000); // Delay
lcd.clear(); // Clear Screen
lcd.setCursor(2, 0); // set the cursor to column 2, line 0
lcd.print("Created by"); // Print "Created By"
lcd.setCursor(4, 1); // set the cursor to column 4, line 1
lcd.print("Amarjit"); // Print "Amarjit"
delay(2000); // Delay
lcd.clear(); // Clear Screen
lcd.setCursor(1, 0); // set the cursor to column 1, line 0
lcd.print("Time & Speed"); // Print "Time & Speed"
lcd.setCursor(5, 1); // set the cursor to column 5, line 1
lcd.print("Min"); // Print "Min"
lcd.setCursor(12, 1); // set the cursor to column 12, line 1
lcd.print("Deg"); // Print "Deg"
}
void loop()
{
lcd.setCursor(14,0); // set the cursor to column 14, line 0
lcd.print("A"); //Print "A"
lcd.setCursor(0, 1); // set the cursor to column 0, line 1
sensorValue = analogRead(sensorPin); // read the value from the sensor
pot_time_display (analogRead (sensorPin));
if (digitalRead(8) == HIGH) // if button is pressed
{ // then go to sub routine
enter_point_b_data();
}
}
void enter_point_b_data()
{
while(1)
{
}
}
void pot_time_display (int SensorValue)
{
switch(sensorValue)
{
case '=0' :lcd.print("0.00");break;
case '>= 1, < 17.05' :lcd.print("0.10");break;
case '>=17.05, < 34.1' :lcd.print("0.20");break;
case '>=34.1, < 51.15' :lcd.print("0.30");break;
case '>=51.15, < 68.2' :lcd.print("0.40");break;
case '>=68.2, < 85.25' :lcd.print("0.50");break;
case '>=85.25, < 102.3' :lcd.print("1.00");break;
}
}