0% found this document useful (0 votes)
2 views3 pages

Arduino Blinking Led Code

The document contains an Arduino sketch that controls an LED to blink in a pattern resembling Morse code. It defines durations for dots and dashes, sets up the LED pin, and repeatedly executes the blinking pattern in the loop function. The final delay allows for a pause before the pattern repeats.

Uploaded by

israelgot55
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Arduino Blinking Led Code

The document contains an Arduino sketch that controls an LED to blink in a pattern resembling Morse code. It defines durations for dots and dashes, sets up the LED pin, and repeatedly executes the blinking pattern in the loop function. The final delay allows for a pause before the pattern repeats.

Uploaded by

israelgot55
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 3

int dot = 100;

int dash = 300;

int ledPin = 7;

int finalDelay = 1500;

void setup() {

// put your setup code here, to run once:

pinMode(ledPin,OUTPUT);

void loop() {

// put your main code here, to run repeatedly:

digitalWrite(ledPin,HIGH);

delay(dot);

digitalWrite(ledPin,LOW);

delay(dot);

digitalWrite(ledPin,HIGH);

delay(dot);

digitalWrite(ledPin,LOW);

delay(dot);

digitalWrite(ledPin,HIGH);

delay(dot);

digitalWrite(ledPin,LOW);

delay(dot);
digitalWrite(ledPin,HIGH);

delay(dash);

digitalWrite(ledPin,LOW);

delay(dash);

digitalWrite(ledPin,HIGH);

delay(dash);

digitalWrite(ledPin,LOW);

delay(dash);

digitalWrite(ledPin,HIGH);

delay(dash);

digitalWrite(ledPin,LOW);

delay(dash);

digitalWrite(ledPin,HIGH);

delay(dot);

digitalWrite(ledPin,LOW);

delay(dot);

digitalWrite(ledPin,HIGH);

delay(dot);

digitalWrite(ledPin,LOW);

delay(dot);

digitalWrite(ledPin,HIGH);

delay(dot);

digitalWrite(ledPin,LOW);

delay(dot);
delay(finalDelay);

You might also like