@kyonoc
A: The following Circuit (Fig-1) and Flow Chart (Fig-2) describe the hardware and behavior of your project.

Figure-1:

Figure-2:
B: the following sketch demonstrates how the LED (connected at DPin-13, Fig-1) could be turned on when Button1 (connected at DPin-2, Fig-1) remains closed for 1-sec time. This is a "building block" with which you can add codes to realize other two functions.
#include <Debounce.h>
Debounce Button1(2);
byte LED = LED_BUILTIN;
bool flag = false;
void setup()
{
Serial.begin(9600);
pinMode(2, INPUT_PULLUP);
pinMode(LED, OUTPUT);
digitalWrite(LED, LOW);
}
void loop()
{
chkButton1();
timeDelay(1000);
if (flag == false)
{
digitalWrite(LED, HIGH);
}
else
{
flag = false;
}
}
void chkButton1()
{
while (!Button1.read() != HIGH) {}
while (!Button1.read() != LOW){}
}
void timeDelay(unsigned long t)
{
unsigned long prMillis = millis();
while (millis() - prMillis <= t)
{
if (!Button1.read() != LOW)
{
flag = true;
break;
}
}
}
C: Please, clarify:
1. If Button1 remains closed for 1-sec, then LED will be turned on. Correct?
2. Now release the Button1 and close it again and if remains closed for 2-sec, then LED blinks for once. Correct? (What is the blinking interval? I mean on-period/off-period.)
3. Now release the Button1 and close it again and if remains closed for 3-sec, then LED will be turend off. Correct?
D: The following sketch performs the tasks of Step-C1 and Step-C2 above.
#include <Debounce.h>
Debounce Button1(2);
byte LED = LED_BUILTIN;
bool flag = false;
bool flag2 = false;
bool flag3 = false;
void setup()
{
Serial.begin(9600);
pinMode(2, INPUT_PULLUP);
pinMode(LED, OUTPUT);
digitalWrite(LED, LOW);
}
void loop()
{
if (flag2 == false)
{
chkButton1(); //for Button1 close condition
timeDelay(1000);
if (flag == false) //button1 remained closed for 1-sec
{
digitalWrite(LED, HIGH);
flag2 = true; //next step to blink
}
else
{
flag = false;
}
}
else
{
chkButton1();
timeDelay(2000);
if(flag == false) //Button1 remained closed for 2-sec
{
digitalWrite(LED, LOW);
delay(500);
digitalWrite(LED, HIGH);
delay(500);
flag3 = true; //next move LED is to be turned off
}
else
{
flag = false;
}
}
}
void chkButton1()
{
while (!Button1.read() != HIGH) {}
while (!Button1.read() != LOW) {}
}
void timeDelay(unsigned long t)
{
unsigned long prMillis = millis();
while (millis() - prMillis <= t)
{
if (!Button1.read() != LOW)
{
flag = true;
break;
}
}
}
E: Veteran programmers may guide us to transform the above non-object sketch into object oriented codes.