My First Arduino Project
Support this website by purchasing prints of my photographs! Check them out here.Here's my first Arduino project. It simply alternates between two LEDs being lit.
int A = 13;
int B = 12;
void setup() {
pinMode(A, OUTPUT);
pinMode(B, OUTPUT);
}
void loop() {
digitalWrite(A, HIGH);
digitalWrite(B, LOW);
delay(1000);
digitalWrite(A, LOW);
digitalWrite(B, HIGH);
delay(1000);
}
Readers familiar with the Arduino will notice that my yellow LED is on pin 13, which has a resistor built in, and the green LED is on pin 12, which does not have one, and may burn out quicker. So pop a resister in there before you run this setup.