int relayState[8] = {LOW, LOW, LOW, LOW, LOW, LOW, LOW, LOW};

int relayPins[8] = {2, 3, 4, 5, 6, 7, 8, 9};

unsigned long timeStamp[8] = {0, 0, 0, 0, 0, 0, 0, 0};

const long interval[8] = {300, 350, 400, 450, 500, 550, 600, 650};

void setup()

{

    for (auto pin : relayPins)

        pinMode(pin, OUTPUT);

}

void loop()

{

    const unsigned long currentTime = micros();

    for (int count = 0; count < 8; count++)

    {

        if (currentTime – timeStamp[count] > interval[count])

        {

            timeStamp[count] = micros();

            if (relayState[count] == LOW)

                relayState[count] = HIGH;

            else if (relayState[count] == HIGH)

                relayState[count] = LOW;

            digitalWrite(relayPins[count], relayState[count]);

        }

    }

}

Lysfase, or Ligth Phase, premiered at the event Winter Solstice organised by Vandaler Forening at Kroloftet in Oslo during the night between December 21st and 22nd 2019.

Thanks to Thom Johansen for technical guidance.

Close Menu