My code is useless to the arduino itself

Just start without the additional led and use the builtin led; use the normal blink sketch. Does it work?

// the setup function runs once when you press reset or power the board
void setup()
 {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

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

Next change the timing in the normal blink sketch (e.g. as below), keep the rest the same. Does it work as expected?

// the setup function runs once when you press reset or power the board
void setup()
 {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop()
{
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(500);
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1500);
}

This will still be a 2 second cycle, but the led will be on for a shorter time; you can play with the numbers as you did before.

If that all works, there is probably nothing wrong except for the fact that you don't use resistors. And yes, you need them to eliminate the chance of damage.

Without the resistor, you draw to much current and as a result
1)
The output pin of the microcontroller and other parts inside the microcontroller can get damaged.
2)
The voltage of the power supply can drop which can cause the Arduino to exhibit unexpected behaviour.

 void setup()
{
  pinMode(13, OUTPUT);
}

void loop()
{
  digitalWrite(13, HIGH);
  delay(500);
  digitalWrite(13,LOW);
  delay(500);
}

Try uploading this and see if you can make the led blink faster...

To answer both of your questions, nothing happens when I change the timing.

https://streamable.com/iofnm

But it is uploading, i can not see if you are changing the timing, change it to 100(ms) and don't show us vids in a loop.

Go to file -> preferences in the IDE. There is a field show verbose output during with two checkboxes (compilation and upload). Tick both.

Compile and upload the code.

Place your cursor in the black output pane at the bottom and select all text; note that you can scroll through that window.

Copy the selected text and past it in a text file and save it.

Attach the file to your next post; the attach option is only available when you click reply, not when you use quick reply.

@Deva_Rishi
I think that it's far too fast for a compile and upload.

sterretje:
@Deva_Rishi
I think that it's far too fast for a compile and upload.

depends on many things (computer cpu power for one thing), if a file has already been compiled once it can be mighty quick, and don't you see the TX & RX LED's light up ?
Does it say "Done Uploading" ? at the bottom in the end that is all the confirmation we need.

I think that it gives "error uploading" although OP has said it does not. I also suspect that OP has selected the wrong board (Uno instead of Mega).

That's why I like to see the full output of both the compile (will tell us what board it is compiled for) and where the upload fails.

This is the text file

here.txt (29.6 KB)

As suspected

Arduino: 1.8.7 (Windows 10), Board: "Arduino/Genuino Uno"

The board in your videos is not an Uno but (by the looks of it) a Mega. Select the correct board under tools -> board.

No errors, he said :slight_smile: Below

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x6b

If you don't have the verbose output during upload enabled, you should still see that. This is my output without that.

Arduino: 1.8.5 (Windows 7), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Archiving built core (caching) in: C:\Users\sterretje\AppData\Local\Temp\arduino_cache_715848\core\core_arduino_avr_mega_cpu_atmega2560_340ee7b99d1d6851600b80336d8bbfb5.a
Sketch uses 1686 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 196 bytes (2%) of dynamic memory, leaving 7996 bytes for local variables. Maximum is 8192 bytes.
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
An error occurred while uploading the sketch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

The bar above the output pane turned orange and a button 'copy error messages' occured and contains the text "An error occured while uploading the sketch". This was done with IDE 1.8.5

But that might be an IDE 1.8.7 thing that you don't see it.

PS
I don't have a Mega so connected an Uno and compiled for a Mega.

You are a genius. Thank you so much for your help, and I'm sorry for being so naive.