Introduction
Blinking LED experiment is quite simple. In the "Hello World!" program, we have come across LED. This time, we are going to connect an LED to one of the digital pins rather than using LED13, which is soldered to the board. Except an Arduino and an USB cable, we will need extra parts as below:
Hardware required
- Red M5 LED*1
- 220Ω resistor*1
- Breadboard*1
- Breadboard jumper wires
Circuit connection
We follow below diagram from the experimental schematic link. Here we use digital pin 10. We connect LED to a 220 ohm resistor to avoid high current damaging the LED.
Sample program
int ledPin = 10; // define digital pin 10. void setup() { pinMode(ledPin, OUTPUT);// define pin with LED connected as output. } void loop() { digitalWrite(ledPin, HIGH); // set the LED on. delay(1000); // wait for a second. digitalWrite(ledPin, LOW); // set the LED off. delay(1000); // wait for a second }
Project list
- Arduino Project 1: Hello World
- Arduino Project 2: LED blinking
- Arduino Project 3: PWM
- Arduino Project 4: Traffic light
- Arduino Project 5: LED chasing effect
- Arduino Project 6: Button-controlled LED
- Arduino Project 7: Responder experiment
- Arduino Project 8: Active buzzer
- Arduino Project 9: Passive buzzer
- Arduino Project 10: Piranha LED Module
- Arduino Project 11: Digital Buzzer Module
- Arduino Project 12: Hall Magnetic Sensor
- Arduino Project 13: collision sensor
- Arduino Project 14: LM35 Linear Temperature Sensor
- Arduino Project 15: Photocell sensor
- Arduino Project 16: Vibration Sensor
- Arduino Project 17: Analog Gas Sensor
- Arduino Project 18: Water Sensor
- Arduino Project 19: PIR Motion Sensor
Buy