user59674: I want to let the led blink for 3 seconds then 2 seconds then one second using the button one time and without using if/else
void setup() {
    // put your setup code here, to run once: 
    pinMode(5, INPUT); 
    pinMode(6, OUTPUT);
} 

void loop() { 
    // put your main code here, to run repeatedly: 
    digitalRead(5, HIGH);
    digitalWrite(6, HIGH); 
    delay(3000);
    digitalWrite(6, LOW);
    digitalWrite(6, HIGH); 
    delay(2000); 
    digitalWrite(6, LOW); 
    digitalWrite(6, HIGH); 
    delay(1000); 
}


user59680: As the required operation is finite and short, you can just hard code the sequence. 

user13325: You could you simple inversion of boolean variable to set state of LED.
const int LedPin = 5;
bool ledState = true;

// in your loop

// bool will be transformed from true to 1 (HIGH)
digitalWrite(LedPin, (int)ledState);
// invert LED state to be false
ledState = !ledState;
// false -> 0 (LOW)
digitalWrite(LedPin, (int)ledState);


user50862: Ternary operator maybe helpful. [Reference]

59674: <p>I want to let the led blink for 3 seconds then 2 seconds then one second using the button one time and without using if/else</p>

<pre><code>void setup() {
    // put your setup code here, to run once: 
    pinMode(5, INPUT); 
    pinMode(6, OUTPUT);
} 

void loop() { 
    // put your main code here, to run repeatedly: 
    digitalRead(5, HIGH);
    digitalWrite(6, HIGH); 
    delay(3000);
    digitalWrite(6, LOW);
    digitalWrite(6, HIGH); 
    delay(2000); 
    digitalWrite(6, LOW); 
    digitalWrite(6, HIGH); 
    delay(1000); 
}
</code></pre>
 59680: <p>As the required operation is finite and short, you can just hard code the sequence. </p>
 13325: <p>You could you simple inversion of boolean variable to set state of LED.</p>
<pre><code>const int LedPin = 5;
bool ledState = true;

// in your loop

// bool will be transformed from true to 1 (HIGH)
digitalWrite(LedPin, (int)ledState);
// invert LED state to be false
ledState = !ledState;
// false -&gt; 0 (LOW)
digitalWrite(LedPin, (int)ledState);
</code></pre>
 50862: <p>Ternary operator maybe helpful. <a href="https://www.tutorialspoint.com/arduino/arduino_conditional_operator.htm" rel="nofollow noreferrer">[Reference]</a></p>
