Setting up a time based led

Im trying to create a program with this statement.

Develop a program such that if you press a touch sensor an LED will light up once, and if the sensor is pressed again within 5 seconds it blinks twice. After the button is pressed the second time (or 5 seconds pass), the program goes back to its original condition (waiting for the first press of the sensor).

I can make it blink twice, but I cannot get the condition to go back after 5 seconds.
what am I doing wrong?

heres my current code

int IR_Pin = 0;

void setup()

void loop()
double newvalue = readValue();
if(newvalue < 60.0){
Serial.print("Distance: ");

double readValue(void)
int a2d = analogRead(IR_Pin);
double value = double(a2d)(5.0/1024.0);
value = 26.855
pow(value, -1.232);
return value;


Welcome to the forums. Please read the sticky post at the beginning of this group. It explains how to post code using tags which makes it easier for people to help you.

I don't see anywhere in the code you posted where you blink an LED once, let alone twice. Post THAT code and maybe we can help.

Your "current code" has no touch sensor and no LEDs. It's no wonder it doesn't do what you want. Would you like to try again?