Quantcast
Channel: Arduino Forum - Latest topics
Viewing all articles
Browse latest Browse all 15598

How to make lights flash on digital output for a set time then stay on

$
0
0

Hi all, kinda new to all this. I have code to make led lights flash (string lights) on and off. However, I'd like it to flash for a set time, then stay on until power is removed. What code would I need to add to my script? Thanks in advance.
Code is:

void setup(){

    pinMode(11, OUTPUT);
    pinMode(10, OUTPUT);
}

void loop(){
    //show colour 1;
    digitalWrite(11, HIGH);
    digitalWrite(10, LOW);

    delay(500); //wait half a second

    //show colour 2:
    digitalWrite(10, HIGH);
    digitalWrite(11, LOW);

    delay(500); //wait half a second

    //any more pattern or changes here...
}

9 posts - 5 participants

Read full topic


Viewing all articles
Browse latest Browse all 15598

Latest Images

Trending Articles



Latest Images