Can someone help me figure what i'm doing wrong with this connection? i am trying to make the LED blink according to the code


int LED1 = 12;
int button = 2;
int buttonValue = 0;
int dot = 300;
int gap = 500;
int dash = 1500;
int endOfWord = 3500;

void setup() {
pinMode(LED1, OUTPUT);
pinMode(button, INPUT);
}
void loop()
{ buttonValue = digitalRead(button);
if (buttonValue == HIGH)
{
digitalWrite(LED1, HIGH);
delay(dash); digitalWrite(LED1, LOW);
delay(gap); digitalWrite(LED1, HIGH);
delay(dash); digitalWrite(LED1, LOW);
delay(gap); digitalWrite(LED1, HIGH);
delay(dot); digitalWrite(LED1, LOW);
delay(gap); digitalWrite(LED1, HIGH);
delay(dot); digitalWrite(LED1, LOW);
delay(gap); digitalWrite(LED1, HIGH);
delay(dash); digitalWrite(LED1, LOW);
delay(gap); digitalWrite(LED1, HIGH);
delay(dot); digitalWrite(LED1, LOW);
delay(gap); digitalWrite(LED1, HIGH);
delay(dash); digitalWrite(LED1, LOW);
delay(gap); digitalWrite(LED1, HIGH);
delay(dot); digitalWrite(LED1, LOW);
delay(gap); digitalWrite(LED1, HIGH);
delay(dot); digitalWrite(LED1, LOW);
delay(gap); digitalWrite(LED1, HIGH);
delay(dash); digitalWrite(LED1, LOW);
delay(gap); digitalWrite(LED1, HIGH);
delay(dash); digitalWrite(LED1, LOW);
delay(gap); digitalWrite(LED1, HIGH);
delay(dot); digitalWrite(LED1, LOW);
delay(gap); digitalWrite(LED1, HIGH);
delay(dot); digitalWrite(LED1, LOW);
delay(gap); digitalWrite(LED1, HIGH);
delay(dot); digitalWrite(LED1, LOW);
delay(gap); digitalWrite(LED1, HIGH);
delay(dot); digitalWrite(LED1, LOW);
delay(gap); digitalWrite(LED1, HIGH);
delay(dot); digitalWrite(LED1, LOW);
delay(gap); digitalWrite(LED1, HIGH);
delay(dot); digitalWrite(LED1, LOW);
delay(gap); digitalWrite(LED1, HIGH);
delay(dot); digitalWrite(LED1, LOW);
delay(gap); digitalWrite(LED1, HIGH);
delay(dot); digitalWrite(LED1, LOW);
delay(endOfWord);
}else{
digitalWrite(LED1, LOW); } }

Why not change the value of LED1 to be LED_BUILTIN, and use the on-board LED?

The code seems to have uploaded correctly on the arduino, it's the connection on the bread board that is not working. I can see the light blinking on Arduino.

Also, i'm sorry if this sounds in poor knowledge as i have just started, i don't know how to use on-board LED.

A proper schematic even hand drawn can be better than a picture.
It may also help you diagnose the issue with the breadboard.

Your post was MOVED to its current location as it is more suitable.

Could you also take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

You just set the value of LED1 to be LED_BUILTIN, then stare at the LED on the board.

The switch resistor (RRR ?) is not connected to the Blue GND wire.

button switches are normally connected between the pin and ground and the pin is configured as INPUT_PULLUP.

the pin will be HIGH normally and LOW when the button is pressed

as for morse timing, see Morse Code Timing (don't forget there's a longer pause between letters)