Assembling Red and Green LED (Parallel)
Materials needed:
- 1 X Arduino Board
- 1 X USB
- 1 X Laptop
- 2 X LED
- 5 X Jumper Wires
- 2 X 330Ω resistors
const int ledG = 13;
const int ledR = 7;
void setup ( )
{
pinMode(ledG, OUTPUT);
pinMode(ledR, OUTPUT);
}
void loop ( )
{
digitalWrite (ledG, HIGH);
digitalWrite (ledR, LOW);
delay(1000);
digitalWrite (ledG, LOW);
digitalWrite (ledR, HIGH);
delay(1000);
}
No comments:
Post a Comment