Yes of course.
Put the analog read into a variable then use that variable to compare your latest reading. By subtracting one from the other you get an idea of how much it has changed and you can use the if statement to control what you do.
The hardest part is deciding exactly what you want to do.
#include <LiquidCrystal.h>
int x;
int lastVal = 0; //set initial value to 0
LiquidCrystal lcd(11, 10, 5, 4, 3, 2); // initialize the library with the numbers of the interface pins
void setup()
{
lcd.begin(20, 4); // set up the LCD's number of columns and rows:
Serial.begin( 9600 ); // initialize the serial communications:
}
void loop()
{
x = analogRead(A0);
if (x > 1000)
{
lcd.setCursor(0, 0);
lcd.print("high");
}
else if (x < lastVal)
{
lcd.setCursor(0, 1);
lcd.print("goes down");
}
else if (x < 700)
{
lcd.setCursor(0, 2);
lcd.print("down");
}
lastVal = x; // 'save' the value of x to next iteration
delay(100);
}
You know, most people in a situation like this would use names like currVal and prevVal to hold the current value and the previous value. But, if these names work for you, fine.
Tell me, though, how x and lastVal will relate to each other a month from now when you look at this code.