To turn on a single LED using an Arduino. The components needed:
Arduino board (e.g., Arduino Uno)
LED (any color)
Resistor (220-330 ohms)
Breadboard
Jumper wires
Follow these steps“
Step 1. Connect the longer leg of the LED (positive terminal / anode) to digital pin 13 on the Arduino. Use a jumper wire and insert one end into pin 13 and the other end into any hole in the breadboard.
Step 2. Connect the shorter leg of the LED (negative terminal / cathode) to the resistor. Insert one end of the resistor into the same row as the LED’s shorter leg.
Step 3. Connect the other end of the resistor to the GND (ground) pin on the Arduino. Use a jumper wire to connect the resistor to any GND pin on the Arduino.
Step 4. Ensure your Arduino is connected to your computer via a USB cable.
Step 5. Open the Arduino IDE (Integrated Development Environment) on your computer. (The software you installed)
Step 6. In the Arduino IDE, select the appropriate board and port from the “Tools“ menu.
Code writing in the Arduino IDE (the software on your computer.
void setup() {
pinMode(10, OUTPUT); // Set pin 10 as an output
}
void loop() {
digitalWrite(10, HIGH); // Turn on the LED
delay(1000); // Wait for 1 second
digitalWrite(10, LOW); // Turn off the LED
delay(1000); // Wait for 1 second
}
Step 8. Please make sure you write the codes well because the little mistake you will make will be resulted in an error.
Step 9. Click on the “Upload“ button in the Arduino IDE to upload the code to your Arduino board. (On your top left on the app)
Step 10. The LED connected to pin 13 should now turn on and off repeatedly, with a 1-second delay between each state change.
NB: You can change the timer (1-second to either 2 or 3 seconds). That is the delay 1000 - 2000 - 3000
Well done for attempting to code.
1 view
977
386
2 weeks ago 00:03:47 1
SCOOTER - HOW MUCH IS THE FISH (Metal cover)
2 weeks ago 00:20:57 1
Incredible Discovery In The Grand Canyon? - YouTube
2 weeks ago 00:29:11 1
Interview with Valentin Kozlov, Valmix Company | Potato Tour Across Russia (Part 2) 🥔🚜
2 weeks ago 00:57:54 1
Lost In Time : The Isolated House Where She Lost Her Mind | How I Find Abandoned Placess
2 weeks ago 01:01:39 1
TIME SLIP STORIES (SN 18 EP 38) TRUE UNEXPLAINABLE EXPERIENCES WITH MISSING TIME & TIME SLIPS
3 weeks ago 00:00:31 2
How To Train Your Dragon | Big Game Spot
3 weeks ago 00:05:05 59
How to Clown - Misha Usov - Professional Clown School
3 weeks ago 00:38:45 2
Try Not To Laugh Challenge#7 | Instant Regret Fails Compilation 2024 | Amazing People
3 weeks ago 00:29:31 1
Membership Perks
3 weeks ago 07:10:32 1
У края бездны-(2024) все серии 1-4. Освобождение Мариуполя.Причитайте ограничения в описании ниже!!
3 weeks ago 00:08:00 16
Dream Theater - Midnight Messiah (Official Video)
3 weeks ago 00:05:14 2
Clara Fernández: The Spanish Sensation Transforming Pole Vaulting
3 weeks ago 00:27:54 5
Секретные космические лазеры устраивают пожары на Земле?
3 weeks ago 01:18:02 2
The Spider’s Web: Britain’s Second Empire | The Secret World of Finance
3 weeks ago 00:03:57 46
Britney Spears - ...Baby One More Time (Official Video)
3 weeks ago 00:17:09 1
Blouse crochet pattern - how to crochet summer top
3 weeks ago 00:15:40 1
Как вязать росток кардигана Вязание укороченными рядами How to knit a cardigan back height
3 weeks ago 00:04:50 20
In The Army Now (Status Quo) • Drum Cover
3 weeks ago 00:38:56 2
Time Team Podcast | New excavations at Pompeii
3 weeks ago 00:56:53 3
DOGMAN, MIRRORED MEN AND HIGHWAY GHOSTS: TALES FROM THE ROAD (SN 18 EP 36) TRUE SPOOKY STORIES
3 weeks ago 00:15:46 2
🐹 КРОТЫ УХОДЯТ НАВСЕГДА! Как прогнать кротов с участка дымовой самодельной шашкой
4 weeks ago 01:12:12 1
Crochet Lacey Vest Tutorial | Chenda DIY
4 weeks ago 00:09:56 1
Mother Tucker: The Donald Trump & Jared Kushner Family Business Suckled From The Tit Of Saudi Arabia
4 weeks ago 00:18:46 1
I Crocheted a Houndstooth Vest | Pattern Walk-through