Appearance
Project 1 Arduino โ
Arduino - Making an LED Blink โ
This is a simple sketch for Arduino that flashes an LED connected to pin 13.
Requirements โ
To run this script, you must have:
- a compatible Arduino board
- One LED
- A resistor (if necessary to limit the current)
- Connecting cables
Connection โ
Connect the LED to pin 13 on the Arduino board. Be sure to use a resistor (usually 220 ohms) in series with the LED to limit the current and protect the LED.
Instructions โ
- Load the sketch into the Arduino IDE.
- Connect the Arduino board to the computer via USB cable.
- Select the correct board type and port in the Arduino IDE.
- Load the sketch onto the Arduino board.
- Observe the LED flashing at regular one-second intervals.
Code โ
cpp
#define LED 13 // LED connected to pin 13
void setup() {
pinMode(LED, OUTPUT); // Set the pin as output
}
void loop() {
digitalWrite(LED, HIGH); // Turn on the LED
delay(1000); // Wait a second
digitalWrite(LED, LOW); // Turn off the LED
delay(1000); // Wait a second
}License โ
Questo script รจ rilasciato sotto la Licenza MIT.
