I bit, this guy will comeback again.. He is like a pigeon, when the
come near the pigeon ,he closes his eyes.. You solve the problem not hide it... :%
Okay, just try:
#include <SerialLCD.h>
#if ARDUINO < 100
#include <NewSoftSerial.h> //this is a must
#else
#include <SoftwareSerial.h>
#endif
SerialLCD slcd(11,12);
int E2 = 5;Â Â Â Â Â Â Â Â Â Â Â Â
int M2 = 4;Â
int sensorPin = A1;
int sensorValue = 0;
int value = 250;
int value2 = 0;
void setup()
{
  pinMode(M2, OUTPUT);
  slcd.begin();
}
void loop()
{
Â
Â
 sensorValue = analogRead(sensorPin);
Â
 while (sensorValue < 1023) { // #1
 Â
 sensorValue = analogRead(sensorPin);
 slcd.clear();
 slcd.setCursor(0, 1);
 slcd.print(sensorValue, DEC);
 Â
 digitalWrite(M2,LOW);  Â
 analogWrite(E2, value);
 Â
 }
Â
Â
Â
while (sensorValue > 1023) {Â // #2
Â
  sensorValue = analogRead(sensorPin);
  slcd.clear();
  slcd.setCursor(0, 1);
  slcd.print(sensorValue, DEC);
 Â
  digitalWrite(M2,HIGH);  Â
  analogWrite(E2, value2); //PWM Speed Control
 Â
}}