Make a Simple LED Circuit

Make an LED turn on and/or blink.

Mar 9, 2018

435303 views

56 respects

Components and supplies

1

Resistor 220 ohm

1

Jumper wires (generic)

1

Arduino UNO

1

LED (generic)

Project description

Code

Simple Code

arduino

Copy and paste this code into your Arduino IDE or Web Editor

LED Blink Code

arduino

Copy and paste this code into your Arduino IDE or Web Editor

LED Blink Code

arduino

Copy and paste this code into your Arduino IDE or Web Editor

Simple Code

arduino

Copy and paste this code into your Arduino IDE or Web Editor

Downloadable files

Diagram

Diagram

Comments

Only logged in users can leave comments

Anonymous user

2 years ago

For the "Make an LED turn on and/or blink." there is a bug in the software. The LED never blinks. You might take a close look at https://www.arduino.cc/en/Tutorial-0007/BlinkingLED to identify the error in your code.

rowan07

2 years ago

Sorry. Maybe if you add a delay(1000) after the digitalWrite(led, LOW)

rowan07

2 years ago

Also there are 2 codes. You may have uploaded the wrong code.

Anonymous user

2 years ago

Topic/Projects • Installation of Arduino IDE and setting up hardware with Arduino IDE. • LED On with Arduino LED Blink with Arduino • LED Control with Keyboard using UART Interfacing of Push button with Arduino mega LED control using Push Button Interfacing IR sensor LED control using IR sensor and visitor counter Interfacing potentiometer with Arduino Interfacing LDR(Light Dependent Resistor) With Arduino LED brightness control using PWM • LED brightness control using Potentiometer and LDR Interfacing Ultrasonic Sensor with Arduino and measuring Distance with LED control Interfacing Flow Sensor with Arduino

Anonymous user

2 years ago

I love seeing lit LEDs there something just hot bout em tbh 9/10 would use them again ' I'm writing with one hand

Anonymous user

2 years ago

it's just simple and exactly what I'm looking for to do my personal project

Anonymous user

2 years ago

This project is very helpful for the beginners It helped me a lot https://roboticshub.in/

Anonymous user

2 years ago

If I have a buzzer already in my circuit and I want the led to go on at the same time, how do I code that?

ShreyanR

2 years ago

Here is how the adjusted code would need to look like - int led = 13; // the pin the LED is connected to int buzzer = 8 //this is 100% DEPENDENT on which digital IO pin the buzzer is connected to void setup() { pinMode(led, OUTPUT); // Declare the LED as an output pinMode(buzzer, OUTPUT); //Declare buzzer as output } void loop() { digitalWrite(led, HIGH); // Turn the LED on digitalWrite(buzzer, HIGH); //Turn the buzzer on } If there is an error in the IDE copy and paste it into a reply to this comment.

Anonymous user

2 years ago

Correct code for blinking led. int led = 13; // the pin the LED is connected to void setup() { pinMode(led, OUTPUT); // Declare the LED as an output } void loop() { digitalWrite(led, HIGH); // Turn the LED on delay(1000);// Wait for 1000 milliseconds (1 second) digitalWrite(led, LOW); // Turn the LED off delay(1000);// Keep it off }

Anonymous user

2 years ago

Sorry but you have to add a semicolon to it. Also, there is a delay. int led = 13; // the pin the LED is connected to void setup() { pinMode(led, OUTPUT);// Declare the LED as an output } void loop() { delay(1000); digitalWrite(led, HIGH); // Turn the LED on }

tharunikan

2 years ago

dr

Anonymous user

2 years ago

its realy good to start

Anonymous user

2 years ago

Please add semicolons after the ) in line 3 and line 7, so it will work!

Anonymous user

2 years ago

My first project on this! I have never been happier to see a flashing red light before. Used the code in the comments to make it flash but the principle is still the same!

Anonymous user

2 years ago

AMA nONCE

Anonymous user

2 years ago

xd

Anonymous user

2 years ago

jh

Anonymous user

2 years ago

It's magic!

Anonymous user

3 years ago

Topic/Projects • Installation of Arduino IDE and setting up hardware with Arduino IDE. • LED On with Arduino LED Blink with Arduino • LED Control with Keyboard using UART Interfacing of Push button with Arduino mega LED control using Push Button Interfacing IR sensor LED control using IR sensor and visitor counter Interfacing potentiometer with Arduino Interfacing LDR(Light Dependent Resistor) With Arduino LED brightness control using PWM • LED brightness control using Potentiometer and LDR Interfacing Ultrasonic Sensor with Arduino and measuring Distance with LED control Interfacing Flow Sensor with Arduino

Anonymous user

3 years ago

I love seeing lit LEDs there something just hot bout em tbh 9/10 would use them again ' I'm writing with one hand

tharunikan

4 years ago

dr

Anonymous user

4 years ago

Sorry but you have to add a semicolon to it. Also, there is a delay. int led = 13; // the pin the LED is connected to void setup() { pinMode(led, OUTPUT);// Declare the LED as an output } void loop() { delay(1000); digitalWrite(led, HIGH); // Turn the LED on }

Anonymous user

4 years ago

Please add semicolons after the ) in line 3 and line 7, so it will work!

Anonymous user

4 years ago

If I have a buzzer already in my circuit and I want the led to go on at the same time, how do I code that?

ShreyanR

2 years ago

Here is how the adjusted code would need to look like - int led = 13; // the pin the LED is connected to int buzzer = 8 //this is 100% DEPENDENT on which digital IO pin the buzzer is connected to void setup() { pinMode(led, OUTPUT); // Declare the LED as an output pinMode(buzzer, OUTPUT); //Declare buzzer as output } void loop() { digitalWrite(led, HIGH); // Turn the LED on digitalWrite(buzzer, HIGH); //Turn the buzzer on } If there is an error in the IDE copy and paste it into a reply to this comment.

Julzbem23

5 years ago

My first project on this! I have never been happier to see a flashing red light before. Used the code in the comments to make it flash but the principle is still the same!

Anonymous user

2 years ago

AMA nONCE

Anonymous user

5 years ago

Correct code for blinking led. int led = 13; // the pin the LED is connected to void setup() { pinMode(led, OUTPUT); // Declare the LED as an output } void loop() { digitalWrite(led, HIGH); // Turn the LED on delay(1000);// Wait for 1000 milliseconds (1 second) digitalWrite(led, LOW); // Turn the LED off delay(1000);// Keep it off }

roboticsgenius

5 years ago

it's just simple and exactly what I'm looking for to do my personal project

Anonymous user

5 years ago

This project is very helpful for the beginners It helped me a lot https://roboticshub.in/

Anonymous user

5 years ago

its realy good to start

wow_666

6 years ago

xd

wow_666

6 years ago

jh

Anonymous user

7 years ago

For the "Make an LED turn on and/or blink." there is a bug in the software. The LED never blinks. You might take a close look at https://www.arduino.cc/en/Tutorial-0007/BlinkingLED to identify the error in your code.

rowan07

2 years ago

Also there are 2 codes. You may have uploaded the wrong code.

eburman

7 years ago

It's magic!