All submissions

Solving Approach

How do you plan to solve it?

Using a 5mm red LED which has 2.1 volts forward voltage drop and 20mA rated current(Reference: https://kitronik.co.uk/products/3504-red-5mm-diffused-led-275mcd?srsltid=AfmBOoq2Jz1oBwwKqtsu2g4FgjyKDImRaeOKAiWnxIyx9sc7qS37dgMM).

  1. Hardware:

    Calculating the resistor value:

    R = ( GPIO - LED Forward Voltage ) / LED Forward Current

    R = (5 - 2.1) / 10 * 10^-3 = 290 Ohm

    Therefore, using  a 100 Ohm resistor. For this LED current will be,  I = (5 - 1.8) / 330 = 8.79mA and this is reasonable.

     

      2.  Software:

          1. Define the LED pin as 2.

          1. In the setup function(void setup()), setup the LED pin as output.

          2. In the loop function(void loop()), turn on the LED, then delay for 400ms, then turn off the LED,               then delay for 800ms.

Code

/*Paste your code here*/
#define LED 2

void setup() {
  // initialize digital pin LED = 2 as an output.
  pinMode(LED, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(400);                      // wait for 400ms
  digitalWrite(LED, LOW);   // turn the LED off by making the voltage LOW
  delay(800);                      // wait for 800ms
}

 

 

 

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!