How do you plan to solve it?
I usually separate this kind of problems in two: Hardware and firmware
Hardware: Let´s find the resistance value that allows a 10mA flowing through the LED
Vin = 5v, Vd = 1.8v ----> Vr = 5v - 1.8v = 3.2v
R = Vr / Ir = 3.2v / 10mA = 320 ohms -----> 330 ohms
/*Paste your code here*/
const int led = 7; // I USED A CONSTANTE VARIABLE TO AVOID UNDESIRED CHANGES
void setup() {
pinMode(led, OUTPUT);
digitalWrite(led,LOW); // I inicialized my led pin in Low state
}
void loop() {
digitalWrite(led,HIGH);
delay(400);
digitalWrite(led,LOW);
delay(800);
}
Add video of the output (know more)
Add a photo of your hardware showing the output.
