Arduino wait for change in value
int oldValue;
void setup()
{
    oldValue = analogRead(A1);
}

void loop()
{
    int value = analogRead(A1);
    while( abs(value-oldValue)&lt;300 )
        delay(1);
    oldValue = value;

    // start blinking lights here, as the value has changed by at least 300

}