LED startup sequence question
this model starship. startup sequence such.
4 leds blink on , off few times stay on slight fade in , out.
once slight fade in , out begins have 3 leds randomly blink on , off , pair of leds that
blink rhythmically turn on.
my code isn't it's functional , have leds doing want them in order like.
my problem add ir remote turn on entire sequence code making difficult. ideally press 1 button initiate sequence , hit same 1 again turn off. can't piece enough unrelated tutorials accomplish , have no programming knowledge. i'm @ whits end can help. thank you.
here code.
const int led1 = 5;
const int led2 = 9;
const int led3 = 10;
const int led4= 3;
int led1 = 5;
int led2 = 9;
int led3 = 10;
int led4 = 3;
int ledpin5 = 2;
int ledpin6 = 4;
int ledpin7 = 13;
int led8 = 12;
void setup() {
pinmode (5, output);
pinmode (9, output);
pinmode (10, output);
pinmode (3, output);
pinmode (12, output);
digitalwrite (5, high);
digitalwrite (9, high);
digitalwrite (10, high);
digitalwrite (3, high);
delay (100);
digitalwrite (5, low);
digitalwrite (9, low);
digitalwrite (10, low);
digitalwrite (3, low);
delay (200);
digitalwrite (5, high);
digitalwrite (9, high);
digitalwrite (10, high);
digitalwrite (3, high);
delay (100);
digitalwrite (5, low);
digitalwrite (9, low);
digitalwrite (10, low);
digitalwrite (3, low);
delay (100);
digitalwrite (5, high);
digitalwrite (9, high);
digitalwrite (10, high);
digitalwrite (3, high);
delay (100);
digitalwrite (5, low);
digitalwrite (9, low);
digitalwrite (10, low);
digitalwrite (3, low);
delay (300);
digitalwrite (5, high);
digitalwrite (9, high);
digitalwrite (10, high);
digitalwrite (3, high);
delay (300);
digitalwrite (5, low);
digitalwrite (9, low);
digitalwrite (10, low);
digitalwrite (3, low);
delay (700);
digitalwrite (5, high);
digitalwrite (9, high);
digitalwrite (10, high);
digitalwrite (3, high);
}
void loop() {
float in, out;
(in = 0; in < 0.541; in = in + 0.001)
{
out = sin(in) * 127.5 + 127.5;
analogwrite(led1,out);
analogwrite(led2,out);
analogwrite(led3,out);
analogwrite(led4,out);
}
{analogwrite(ledpin5, random(100, 200));
delay(random(105));
analogwrite(ledpin6, random(100, 200));
delay(random(115));
analogwrite(ledpin7, random(100, 200 ));
delay(random(110));
}
{
digitalwrite(led8, high); // turn led on (high voltage level)
delay(500); // wait second
digitalwrite(led8, low); // turn led off making voltage low
delay(500); // wait second
}
}
4 leds blink on , off few times stay on slight fade in , out.
once slight fade in , out begins have 3 leds randomly blink on , off , pair of leds that
blink rhythmically turn on.
my code isn't it's functional , have leds doing want them in order like.
my problem add ir remote turn on entire sequence code making difficult. ideally press 1 button initiate sequence , hit same 1 again turn off. can't piece enough unrelated tutorials accomplish , have no programming knowledge. i'm @ whits end can help. thank you.
here code.
const int led1 = 5;
const int led2 = 9;
const int led3 = 10;
const int led4= 3;
int led1 = 5;
int led2 = 9;
int led3 = 10;
int led4 = 3;
int ledpin5 = 2;
int ledpin6 = 4;
int ledpin7 = 13;
int led8 = 12;
void setup() {
pinmode (5, output);
pinmode (9, output);
pinmode (10, output);
pinmode (3, output);
pinmode (12, output);
digitalwrite (5, high);
digitalwrite (9, high);
digitalwrite (10, high);
digitalwrite (3, high);
delay (100);
digitalwrite (5, low);
digitalwrite (9, low);
digitalwrite (10, low);
digitalwrite (3, low);
delay (200);
digitalwrite (5, high);
digitalwrite (9, high);
digitalwrite (10, high);
digitalwrite (3, high);
delay (100);
digitalwrite (5, low);
digitalwrite (9, low);
digitalwrite (10, low);
digitalwrite (3, low);
delay (100);
digitalwrite (5, high);
digitalwrite (9, high);
digitalwrite (10, high);
digitalwrite (3, high);
delay (100);
digitalwrite (5, low);
digitalwrite (9, low);
digitalwrite (10, low);
digitalwrite (3, low);
delay (300);
digitalwrite (5, high);
digitalwrite (9, high);
digitalwrite (10, high);
digitalwrite (3, high);
delay (300);
digitalwrite (5, low);
digitalwrite (9, low);
digitalwrite (10, low);
digitalwrite (3, low);
delay (700);
digitalwrite (5, high);
digitalwrite (9, high);
digitalwrite (10, high);
digitalwrite (3, high);
}
void loop() {
float in, out;
(in = 0; in < 0.541; in = in + 0.001)
{
out = sin(in) * 127.5 + 127.5;
analogwrite(led1,out);
analogwrite(led2,out);
analogwrite(led3,out);
analogwrite(led4,out);
}
{analogwrite(ledpin5, random(100, 200));
delay(random(105));
analogwrite(ledpin6, random(100, 200));
delay(random(115));
analogwrite(ledpin7, random(100, 200 ));
delay(random(110));
}
{
digitalwrite(led8, high); // turn led on (high voltage level)
delay(500); // wait second
digitalwrite(led8, low); // turn led off making voltage low
delay(500); // wait second
}
}
forget main project now.
have managed use ir control simple such turning on led or output message serial ??
have managed use ir control simple such turning on led or output message serial ??
Arduino Forum > Using Arduino > Programming Questions > LED startup sequence question
arduino
Comments
Post a Comment