Devices & Components
Arduino Uno Rev3
Resistor 220 ohm
Jumper wires (generic)
LED (generic)
Project description
Code
Simple Code
arduino
Copy and paste this code into your Arduino IDE or Web Editor
1#define LED 13 // The pin the LED is connected to 2void setup() { 3 pinMode(LED, OUTPUT); // Declare the LED as an output 4} 5 6void loop() { 7 digitalWrite(LED, HIGH); // Turn the LED on 8} 9
LED Blink Code
arduino
Copy and paste this code into your Arduino IDE or Web Editor
1#define LED 13 // the pin the LED is connected to 2 3void setup() { 4 pinMode(LED, OUTPUT); // Declare the LED as an output 5} 6 7void loop() { 8 digitalWrite(LED, HIGH); // Turn the LED on 9 delay(1000); // Wait for 1000 milliseconds (1 second) 10 digitalWrite(LED, LOW); // Turn the LED off 11 delay(1000); // Wait for 1000 milliseconds (1 second) 12}
LED Blink Code
arduino
Copy and paste this code into your Arduino IDE or Web Editor
1#define LED 13 // the pin the LED is connected to 2 3void setup() { 4 pinMode(LED, OUTPUT); // Declare the LED as an output 5} 6 7void loop() { 8 digitalWrite(LED, HIGH); // Turn the LED on 9 delay(1000); // Wait for 1000 milliseconds (1 second) 10 digitalWrite(LED, LOW); // Turn the LED off 11 delay(1000); // Wait for 1000 milliseconds (1 second) 12}
Simple Code
arduino
Copy and paste this code into your Arduino IDE or Web Editor
1#define LED 13 // The pin the LED is connected to 2void setup() { 3 pinMode(LED, OUTPUT); // Declare the LED as an output 4} 5 6void loop() { 7 digitalWrite(LED, HIGH); // Turn the LED on 8} 9
Downloadable files
Diagram
Diagram

Comments
Only logged in users can leave comments