Created
May 6, 2017 20:10
-
-
Save ro31337/688cb850462918ea067fd70b7b286346 to your computer and use it in GitHub Desktop.
Arduino morse SOS code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int ledPin = 11; | |
| void setup() { | |
| pinMode(ledPin, OUTPUT); | |
| } | |
| void dash() { | |
| digitalWrite(ledPin, HIGH); | |
| delay(1000); | |
| digitalWrite(ledPin, LOW); | |
| delay(300); | |
| } | |
| void dot() { | |
| digitalWrite(ledPin, HIGH); | |
| delay(400); | |
| digitalWrite(ledPin, LOW); | |
| delay(300); | |
| } | |
| void space() { | |
| delay(1000); | |
| } | |
| void loop() { | |
| // SOS is: | |
| // --- ... --- | |
| dash(); | |
| dash(); | |
| dash(); | |
| space(); | |
| dot(); | |
| dot(); | |
| dot(); | |
| space(); | |
| dash(); | |
| dash(); | |
| dash(); | |
| space(); | |
| space(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment