https://www.circuitbasics.com/how-to-control-leds-on-the-arduino/
int redLED = 13;
int greenLED = 2;
void setup() {
pinMode(redLED, OUTPUT);
pinMode(greenLED, OUTPUT);
}
void loop() {
digitalWrite(redLED, HIGH);
delay(1000);
digitalWrite(redLED, LOW);
delay(1000);
digitalWrite(greenLED, HIGH);
delay(1000);
digitalWrite(greenLED, LOW);
delay(1000);
}
Prompt
In this activity, we will learn how to program and control electronics to enhance the user experience of our devices.We will learn to use Arduino with inputs and outputs to incrementally build towards the project's expected behavior.
Instructions
Start by downloading and installing the Arduino software library. Then, follow the tutorials and examples provided to familiarize yourself with the basics of programming with Arduino.
Next, step by step, build towards the project's expected behavior. Start by controlling a single LED light and gradually adding more features. Make sure to test each step along the way to ensure that everything is working as expected.
Deliverables
Your final product should be a functioning circuit that meets the project's expected behavior. You should document your progress along the way and create a set of slides to present to the studio. Your presentation should include a demo of the project and a discussion of the challenges you faced and how you overcame them. This will help others learn from your experience and understand the steps involved in using Arduino.