This was our fist attempt at building our light show. It has the basics and only 2 led lights
This was our final project for arduino. We had to use a bigger bread bored for this because we used more LED lights and that includes more wiring. We made the lights flicker as fast as we can in a random order.
/*
Speed Controlled Blinking Lights, BKnudson 3/31/17 Novato High School
The potentiometer controls the speed of 2 blinking lights
*/
int led = 13;
int led3 = 12;
int led2 = 11;
int led4 = 10;
int potPin= 1;
int time = 3;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pins as an output.
pinMode(led, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
// initialize the analog pin as input
pinMode(potPin, INPUT);
}
// the loop routine runs over and over again forever:
void loop() {
int t=analogRead(potPin); //set the delay value from the potentiometer
digitalWrite(led3,HIGH); // wait for a second // wait for a second
digitalWrite(led2,HIGH); // wait for a second
digitalWrite(led2,LOW);
digitalWrite(led3,LOW); // wait for a second
digitalWrite(led,HIGH);
digitalWrite(led4,HIGH); // turn the LED2 on (HIGH is the voltage level // wait for a second
digitalWrite(led4,LOW);
digitalWrite(led,LOW);// turn the LED2 off by making the voltage LOW
delay(50);
}// wait for a second
Speed Controlled Blinking Lights, BKnudson 3/31/17 Novato High School
The potentiometer controls the speed of 2 blinking lights
*/
int led = 13;
int led3 = 12;
int led2 = 11;
int led4 = 10;
int potPin= 1;
int time = 3;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pins as an output.
pinMode(led, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
// initialize the analog pin as input
pinMode(potPin, INPUT);
}
// the loop routine runs over and over again forever:
void loop() {
int t=analogRead(potPin); //set the delay value from the potentiometer
digitalWrite(led3,HIGH); // wait for a second // wait for a second
digitalWrite(led2,HIGH); // wait for a second
digitalWrite(led2,LOW);
digitalWrite(led3,LOW); // wait for a second
digitalWrite(led,HIGH);
digitalWrite(led4,HIGH); // turn the LED2 on (HIGH is the voltage level // wait for a second
digitalWrite(led4,LOW);
digitalWrite(led,LOW);// turn the LED2 off by making the voltage LOW
delay(50);
}// wait for a second