VIP lighting

CREATOR_RAM

New Member
Joined
Oct 9, 2021
Messages
1
Reaction score
0
Credits
13
Vip lighting using
Arduino UNO
Jumper wires
4 Red lights
5 Blue lights
Code:

void setup() {

pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);

}

void loop() {

int time = 100;

for (int o = 1; o < 10; o = o + 1) {
digitalWrite ( o, HIGH);
delay(time);
digitalWrite ( o, LOW);
}
}
 


Fanboi

Well-Known Member
Joined
Apr 16, 2021
Messages
358
Reaction score
270
Credits
4,288
Vip lighting using
Arduino UNO
Jumper wires
4 Red lights
5 Blue lights
Code:

void setup() {

pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);

}

void loop() {

int time = 100;

for (int o = 1; o < 10; o = o + 1) {
digitalWrite ( o, HIGH);
delay(time);
digitalWrite ( o, LOW);
}
}
You may wanna put code in tags
[code ]
Your code here
[/code ]
(without the space) as this keeps indentations.

Recommendation:
Code:
/* Will try not to modify your var names */

/* Suggest a return val for errors.
 * Suggest being able pass delay "time"
 * to function for future flexibility
 */

int
loop (int time) {
    /* o = o + 1 is the same as o++ here */
    for (int o = 1; o < 10; o++) {
        digitalWrite ( o, HIGH);
        delay(time);
        digitalWrite ( o, LOW);
    }
    return 0; /* Until we need debugging, etc. */
}
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Latest posts

Top