CODE | LED SOS Morse Code Singal - Arduino Project 002

RonWang3 years ago (2023-05-13)电子编程 COD6

Arduino 电子编程--灯项目及控制,主要使用Arduino编程控制LED灯,实现基本控制Project 2 LED闪烁S.O.S信号。

Project 2 S.O.S Morse Signal

002 LED SOS Circuit

// LED connected to pin 10
// Project 2 - LED SOS Morse Singal 
/* Coding Ron Wang
   May 28th 2024
   Autaba support for coding hardware
 */
int ledPin = 10;
// run once, when the sketch starts
void setup()
{
 // sets the pin as output
 pinMode(ledPin, OUTPUT);
}
// run over and over again
void loop()
{
 // 3 dits
 for (int x=0; x<3; x++) {
 digitalWrite(ledPin, HIGH); // sets the LED on
 delay(150); // waits for 150ms
 digitalWrite(ledPin, LOW); // sets the LED off
 delay(100); // waits for 100ms
 }
 // 100ms delay to cause slight gap betyouen letters
 delay(100);
 // 3 dahs
 for (int x=0; x<3; x++) {
 digitalWrite(ledPin, HIGH); // sets the LED on
 delay(400); // waits for 400ms
 digitalWrite(ledPin, LOW); // sets the LED off
 delay(100); // waits for 100ms
 }
 // 100ms delay to cause slight gap betyouen letters
 delay(100);
 // 3 dits again
 for (int x=0; x<3; x++) {
 digitalWrite(ledPin, HIGH); // sets the LED on
 delay(150); // waits for 150ms
 digitalWrite(ledPin, LOW); // sets the LED off
 delay(100); // waits for 100ms
 }
 // wait 5 seconds before repeating the SOS signal
 delay(5000);
}

                             

Share with Friends:

Related Articles

CODE | Human Body Infrared Detector and Relay Light - Arduino Project 048

CODE | Human Body Infrared Detector and Relay Light - Arduino Project 048

Project 48 Human Body Infrared Detector and Relay LightThis Infrared Human Sensor referenc…

CODE | Simple Motor Control - Arduino Project 015

CODE | Simple Motor Control - Arduino Project 015

First, you’re going to simply control the speed of a DC motor in one direction, using a power transi…

CODE | BMP280 Pressure Sensor LCD Display - Arduino Project 032

CODE | BMP280 Pressure Sensor LCD Display - Arduino Project 032

For this project we will use Arduino Uno and BMP280 along with LCD 16x2 display module to display te…

Books Exploring Arduino Book by Jeremy Blum

Books Exploring Arduino Book by Jeremy Blum

Exploring Arduino uses the popular Arduino microcontroller platform as an instrument…

CODE | Piezo Sounder Melody Player - Arduino Project 012

CODE | Piezo Sounder Melody Player - Arduino Project 012

Rather than using the piezo to make annoying alarm sounds, why not use it to play a melody? You are…

How to Understand and Select the Right Wire Specifications

How to Understand and Select the Right Wire Specifications

如何读懂和选用合适的电线的规格?初级电线标准和规格入门知识American Wire Gauge “AWG” Chart – Wire Size & Ampacity TableAmerica…

Post a Comment

Anonymous

Feel free to share your thoughts and opinions here.