Arduino GPIO LED Blink

pratidnyakanse
pratidnyakanse

Solving Approach

How do you plan to solve it?

 Steps:

  1. First, calculate the value of the resistor.
  2. Then, build the circuit.
  3. Finally, write code to turn the LED on and off at a given time interval.

To calculate the resistor value:

  1. The voltage drop across the LED is 1.8V, and the supply voltage is 5V.
  2. The desired current through the LED is 10mA.

So,

R  = 5V−1.8V /10mA

     =  3.2V / 0.01A

     = 320 Ω

 

 

 

Code

/*Paste your code here*/
void setup(){
  pinMode(13, OUTPUT);
}
void loop(){
  digitalWrite(13,HIGH);
  delay(400);
  digitalWrite(13,LOW);
  delay(800);
}

 

 

 

Output

Video

Add video of the output (know more)

 

 

Photo of Output

Add a photo of your hardware showing the output.

 

Submit Your Solution

Note: Once submitted, your solution goes public, helping others learn from your approach!