(LIGHT WAVE - DIGITAL)
Light wave |
- Laptop
- Arduino Board
- Breadboard
- 4 LED (different colours)
- 4 X 330Ω Resistors
- 9 X Jumper Wires
Codes:
const int ledR = 11;
const int ledY = 10;
const int ledG = 6;
const int ledB = 5;
void setup()
{
pinMode(ledR, OUTPUT);
pinMode(ledY, OUTPUT);
pinMode(ledG, OUTPUT);
pinMode(ledB, OUTPUT);
}
void loop()
{
digitalWrite(ledR, HIGH);
delay(500);
digitalWrite(ledR, LOW);
digitalWrite(ledY, HIGH);
delay(500);
digitalWrite(ledY, LOW);
digitalWrite(ledG, HIGH);
delay(500);
digitalWrite(ledG, LOW);
digitalWrite(ledB, HIGH);
delay(500);
digitalWrite(ledB, LOW);
digitalWrite(ledG, HIGH);
delay(500);
digitalWrite(ledG, LOW);
digitalWrite(ledY, HIGH);
delay(500);
digitalWrite(ledY, LOW);
digitalWrite(ledR, HIGH);
delay(500);
digitalWrite(ledR, LOW);
delay(1000);
}
No comments:
Post a Comment