Hi ALL --
This is my Code - 
//---------------LCD --------------------------
#include <Wire.h>
#include <LiquidCrystal_PCF8574.h>
LiquidCrystal_PCF8574 lcd(0x27);
#define ok 8
#define up 9
#define down 10
int count = 0;
int PBdelay = 200;
int state = 0;
int stateA = 0;
int push =0;
int qty =0;
int len = 0;
int countA = 0;
int countB = 0;
int i = 0;
//------------- STEPPER ------------------
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
const int analogOutPin = 13; // Analog output pin that the LED is attached to
int sensorValue = 0; // value read from the pot
int outputValue = 0; // value output to the PWM (analog out)
int PUL = 7; //define Pulse pin
int DIR = 6; //define Direction pin
int ENA = 5; //define Enable Pin
void setup() {
pinMode (PUL, OUTPUT);
pinMode (DIR, OUTPUT);
pinMode (ENA, OUTPUT);
// Serial.begin(9600);
//------------LCD -------------------
lcd.begin(16, 2); // initialize the lcd
//-----------------------------------
}
void loop() {
digitalWrite(ENA, LOW); // not to let the Stepper Energised when not
//Serial.println(value_potentiometer);
// read the analog in value:
sensorValue = analogRead(analogInPin);
// Serial.println( sensorValue);
// map it to the range of the analog out:
outputValue = map(sensorValue, 0, 1023, 0, 500);
// Serial.println(outputValue);
// change the analog out value:
// analogWrite(analogOutPin, outputValue);
digitalWrite(DIR, LOW);
digitalWrite(ENA, HIGH);
digitalWrite(PUL, HIGH);
delayMicroseconds (outputValue);
digitalWrite(PUL, LOW);
delayMicroseconds(outputValue);
// wait 2 milliseconds before the next loop for the analog-to-digital
// converter to settle after the last reading:
delay(1);
//Serial.println(outputValue);
//--------lcd-------------------
lcd.setBacklight(255);
lcd.home(); lcd.clear();
lcd.print(outputValue);
delay(1000);
// lcd.clear();
// delay(1000);
// lcd.setCursor(1,2);
// lcd.cursor();
// delay(1000);
//------------------------------------
}