Skip to main content
Improved some code formatting and some spelling and title
Source Link

Multiple variables Checking for multiple values in IF separated by commata

My code is:

if ((minute == 31) && (hour == 4, 6, 9, 11))  
{
        digitalWrite(8, HIGH);
    }

I want to turn on LED,the LEDs when it is exactly 04:31, 06:31, 09:31, 11:31.

  • 04:31,
  • 06:31,
  • 09:31,
  • 11:31

However, the code above doesn't work. Might
Might be the multiple values the reason for this?

Multiple variables values in IF

if ((minute == 31) && (hour == 4, 6, 9, 11)) {
        digitalWrite(8, HIGH);
    }

I want to turn on LED, when it is exactly 04:31, 06:31, 09:31, 11:31. However the code above doesn't work. Might be the multiple values reason for this?

Checking for multiple values in IF separated by commata

My code is:

if ((minute == 31) && (hour == 4, 6, 9, 11))  
{
  digitalWrite(8, HIGH);
}

I want to turn on the LEDs when it is exactly

  • 04:31,
  • 06:31,
  • 09:31,
  • 11:31

However, the code above doesn't work.
Might be the multiple values the reason for this?

added 221 characters in body
Source Link
if ((minute == 31) && (hour == 4, 6, 9, 11)) {
        digitalWrite(8, HIGH);
    }

I want to turn on LED, when it is exactly 04:31, 06:31, 09:31, 11:31. However the code above doesn't work. Might be the multiple values reason for this?

if ((minute == 31) && (hour == 4, 6, 9, 11)) {
        digitalWrite(8, HIGH);
    }

I want to turn on LED, when it is exactly 04:31, 06:31, 09:31, 11:31. However the code above doesn't work. Might be the multiple values reason for this?

if ((minute == 31) && (hour == 4, 6, 9, 11)) {
        digitalWrite(8, HIGH);
    }

I want to turn on LED, when it is exactly 04:31, 06:31, 09:31, 11:31. However the code above doesn't work. Might be the multiple values reason for this?

Source Link

Multiple variables values in IF

if ((minute == 31) && (hour == 4, 6, 9, 11)) {
        digitalWrite(8, HIGH);
    }

I want to turn on LED, when it is exactly 04:31, 06:31, 09:31, 11:31. However the code above doesn't work. Might be the multiple values reason for this?