First I calculated according to the ohm's law formula I=U/R. The voltage here is minus 1.8v (voltage dissipated on the led), so the output voltage is 3.8v. I divided it by 10mA and got the resistance of 330ohm. Then I used Tinkercad to simulate. In the code, I used the delay function to solve the problem of lighting up for 400ms and turning off for 800ms.
Code
/*Paste your code here*/
int led =3;
void setup()
{
pinMode(led, OUTPUT);
}
void loop()
{
digitalWrite(led,HIGH);
delay(400);
digitalWrite(led,LOW);
delay(600);
}