Arduino time(milli) and pressure sensor I've succeeded to get an Arduino to work with a pressure sensor.

What I want to do is 


when I put pressure on the sensor, after 5 minutes the led lights on.
it starts over again if there's no pressure on the sensor.


Here's the program:

// FSR is verbonden met analoog 0 
int fsrAnalogePin = 0; 
// De LED is verbonden met pin 11 (pmw pin) 
int LEDpin = 11; 
// De analoge waarde van de fsr spanningdeler 
int fsrWaarde; 
// De helderheid van de led tussen 0 en 255 
int LEDhelderheid; 

void setup() { 
    // start de serial monitor 
    Serial.begin(9600); 
    pinMode(LEDpin, OUTPUT); 
} 

void loop() { 
    fsrWaarde = analogRead(fsrAnalogePin); 
    // print ‘Analoge waarde’ 
    Serial.print(“Analoge waarde = “); 
    // print de fsrwaarde op de monitor 
    Serial.println(fsrWaarde); 

    // maak van getallen tussen 0 en 1023 getallen tussen 0 en 255 
    LEDhelderheid = map(fsrWaarde, 0, 50, 0, 255); 
    analogWrite(LEDpin, LEDhelderheid); 
    delay(100); 
}


I've got this for the pressure sensor... now I need to combine it with 5 minutes and the led lights on when it's reached that 5 min of pressure.

i managed to do this but it aint enough...

unsigned long currentTime;
unsigned long startTime;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  currentTime = millis();
  startTime = currentTime;
}

    void loop() {
  currentTime = millis();
  // put your main code here, to run repeatedly: 
  Serial.println(currentTime);
  delay(1000); 

  if(currentTime-startTime &gt; 6000) {
Serial.println("1 minuut voorbij");
startTime = currentTime;
  }
}
Try this:

unsigned long pressureOnTime; //millis() time when pressure switch is first turned on

const unsigned long ledOnAfterTimeThreshold = 300000; //5 minutes * 60 sec * 1000 mSec
int pressureThreshold = 1; //minimum analog reading from pressure sensor considered to be "on"

const int fsrAnalogePin = 0; 
const int ledPin = 11; 

int ledState = LOW;
int pressureState = LOW;

void setup() {
    Serial.begin(9600);
}

void loop() {
    checkPressureSwitch();  

    //do other stuff here
}


void checkPressureSwitch() {
    if( analogRead(fsrAnalogePin) &gt;=  pressureThreshold ) 
    {
        handlePressureOn();
    }
    else 
    {
        handlePressureOff();
    }

    digitalWrite(ledPin, ledState);
}

void handlePressureOn() {
    if ( pressureState == LOW )
    {
        //pressure switch was off, but is now on
        pressureOnTime = millis();
        pressureState = HIGH;
    }

    else if ( millis() - pressureOnTime &gt;= ledOnAfterTimeThreshold ) 
    {
        ledState = HIGH;
    }
}

void handlePressureOff() {
    ledState = LOW;
    pressureState = LOW;
}