// Pin assignments const int ledPin1 = 7; const int ledPin2 = 8; const int ledPin3 = 12; void setup() { // Initialize the digital pins as outputs pinMode(ledPin1, OUTPUT); pinMode(ledPin2, OUTPUT); pinMode(ledPin3, OUTPUT); } void loop() { // Turn on LED connected to pin 7 digitalWrite(ledPin1, HIGH); delay(5000); // Wait for 5 seconds // Turn off LED connected to pin 7 digitalWrite(ledPin1, LOW); delay(2000); // Wait for 2 seconds // Turn on LED connected to pin 8 digitalWrite(ledPin2, HIGH); delay(5000); // Wait for 5 seconds // Turn off LED connected to pin 8 digitalWrite(ledPin2, LOW); delay(2000); // Wait for 2 seconds // Turn on LED connected to pin 12 digitalWrite(ledPin3, HIGH); delay(5000); // Wait for 5 seconds // Turn off LED connected to pin 12 digitalWrite(ledPin3, LOW); delay(2000); // Wait for 2 seconds }
Where is code
// Pin assignments
const int ledPin1 = 7;
const int ledPin2 = 8;
const int ledPin3 = 12;
void setup() {
// Initialize the digital pins as outputs
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
}
void loop() {
// Turn on LED connected to pin 7
digitalWrite(ledPin1, HIGH);
delay(5000); // Wait for 5 seconds
// Turn off LED connected to pin 7
digitalWrite(ledPin1, LOW);
delay(2000); // Wait for 2 seconds
// Turn on LED connected to pin 8
digitalWrite(ledPin2, HIGH);
delay(5000); // Wait for 5 seconds
// Turn off LED connected to pin 8
digitalWrite(ledPin2, LOW);
delay(2000); // Wait for 2 seconds
// Turn on LED connected to pin 12
digitalWrite(ledPin3, HIGH);
delay(5000); // Wait for 5 seconds
// Turn off LED connected to pin 12
digitalWrite(ledPin3, LOW);
delay(2000); // Wait for 2 seconds
}