I want to make two leds blink in the same program, this is the code Im using
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
digitalWrite(12, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(12, LOW); // turn the LED off by making the voltage LOW
delay(1000);
}
the computer send me an error when I upload it, What should I change?
It compiles and runs fine omm. What exactly does the red, error text say? Just copy and paste it in a quote. I suspect you are not correctly connected to your Arduino, so explain how you have it connected to your computer as well please.