Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e13df73
Showing
20 changed files
with
389 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
|
||
int ledPin = 13; // LED connected to digital pin 13 | ||
int length = 300; // Unit length in miliseconds | ||
|
||
char* lookup[] = { | ||
".-", | ||
"-...", | ||
"-.-.", | ||
"-..", | ||
".", | ||
"..-.", | ||
"--.", | ||
"....", | ||
"..", | ||
".---", | ||
".-.-", | ||
".-..", | ||
"--", | ||
"-.", | ||
"---", | ||
".--.", | ||
"--.-", | ||
".-.", | ||
"...", | ||
"-" , | ||
"..-" , | ||
"...-", | ||
".--" , | ||
"-..-", | ||
"-.--", | ||
"--.." | ||
}; | ||
|
||
void setup() { | ||
pinMode(ledPin, OUTPUT); // sets the digital pin as output | ||
} | ||
|
||
|
||
void long_mark() { | ||
digitalWrite(ledPin, HIGH); | ||
delay(length*3); | ||
digitalWrite(ledPin, LOW); | ||
} | ||
|
||
void short_mark() { | ||
digitalWrite(ledPin, HIGH); | ||
delay(length); | ||
digitalWrite(ledPin, LOW); | ||
} | ||
|
||
void intra_char_gap() { | ||
delay(length); | ||
} | ||
|
||
void char_gap() { | ||
delay(length*3); | ||
} | ||
|
||
void word_gap() { | ||
delay(length); | ||
} | ||
|
||
void blink_char(char c) { | ||
if(c == '-') | ||
long_mark(); | ||
else | ||
short_mark(); | ||
intra_char_gap(); | ||
} | ||
|
||
void blink(char str[]) { | ||
int c; | ||
int ic; | ||
for(c=0; c<strlen(str); c++) { | ||
if(str[c] == ' ') | ||
word_gap(); | ||
else { | ||
int idx = (int)str[c] - 65; | ||
char* chr = lookup[idx]; | ||
for(ic=0; ic<strlen(chr); ic++) { | ||
blink_char(chr[ic]); | ||
} | ||
char_gap(); | ||
} | ||
} | ||
} | ||
|
||
void loop() { | ||
blink("SOS"); | ||
delay(5000); | ||
} |
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
|
||
#include "WProgram.h" | ||
void setup(); | ||
void long_mark(); | ||
void short_mark(); | ||
void intra_char_gap(); | ||
void char_gap(); | ||
void word_gap(); | ||
void blink_char(char c); | ||
void blink(char str[]); | ||
void loop(); | ||
int ledPin = 13; // LED connected to digital pin 13 | ||
int length = 300; // Unit length in miliseconds | ||
|
||
char* lookup[] = { | ||
".-", | ||
"-...", | ||
"-.-.", | ||
"-..", | ||
".", | ||
"..-.", | ||
"--.", | ||
"....", | ||
"..", | ||
".---", | ||
".-.-", | ||
".-..", | ||
"--", | ||
"-.", | ||
"---", | ||
".--.", | ||
"--.-", | ||
".-.", | ||
"...", | ||
"-" , | ||
"..-" , | ||
"...-", | ||
".--" , | ||
"-..-", | ||
"-.--", | ||
"--.." | ||
}; | ||
|
||
void setup() { | ||
pinMode(ledPin, OUTPUT); // sets the digital pin as output | ||
} | ||
|
||
|
||
void long_mark() { | ||
digitalWrite(ledPin, HIGH); | ||
delay(length*3); | ||
digitalWrite(ledPin, LOW); | ||
} | ||
|
||
void short_mark() { | ||
digitalWrite(ledPin, HIGH); | ||
delay(length); | ||
digitalWrite(ledPin, LOW); | ||
} | ||
|
||
void intra_char_gap() { | ||
delay(length); | ||
} | ||
|
||
void char_gap() { | ||
delay(length*3); | ||
} | ||
|
||
void word_gap() { | ||
delay(length); | ||
} | ||
|
||
void blink_char(char c) { | ||
if(c == '-') | ||
long_mark(); | ||
else | ||
short_mark(); | ||
intra_char_gap(); | ||
} | ||
|
||
void blink(char str[]) { | ||
int c; | ||
int ic; | ||
for(c=0; c<strlen(str); c++) { | ||
if(str[c] == ' ') | ||
word_gap(); | ||
else { | ||
int idx = (int)str[c] - 65; | ||
char* chr = lookup[idx]; | ||
for(ic=0; ic<strlen(chr); ic++) { | ||
blink_char(chr[ic]); | ||
} | ||
char_gap(); | ||
} | ||
} | ||
} | ||
|
||
void loop() { | ||
blink("SOS"); | ||
delay(5000); | ||
} | ||
int main(void) | ||
{ | ||
init(); | ||
|
||
setup(); | ||
|
||
for (;;) | ||
loop(); | ||
|
||
return 0; | ||
} | ||
|
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
:00000001FF |
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
:100000000C9461000C947E000C947E000C947E0095 | ||
:100010000C947E000C947E000C947E000C947E0068 | ||
:100020000C947E000C947E000C947E000C947E0058 | ||
:100030000C947E000C947E000C947E000C947E0048 | ||
:100040000C9441010C947E000C947E000C947E0074 | ||
:100050000C947E000C947E000C947E000C947E0028 | ||
:100060000C947E000C947E00000000002400270009 | ||
:100070002A0000000000250028002B0000000000DE | ||
:1000800023002600290004040404040404040202DA | ||
:100090000202020203030303030301020408102007 | ||
:1000A0004080010204081020010204081020000012 | ||
:1000B0000007000201000003040600000000000029 | ||
:1000C000000011241FBECFEFD8E0DEBFCDBF11E08E | ||
:1000D000A0E0B1E0E8E0F5E002C005900D92AA3A98 | ||
:1000E000B107D9F711E0AAEAB1E001C01D92A63B21 | ||
:1000F000B107E1F70E943A010C9482020C940000CF | ||
:100100006091730170917401882777FD8095982F15 | ||
:100110000E94B10108952091730130917401B901D9 | ||
:10012000660F771F620F731F882777FD8095982FC2 | ||
:100130000E94B10108956091730170917401882744 | ||
:1001400077FD8095982F0E94B101089580917101EB | ||
:1001500061E00E94350260917301709174018827FB | ||
:1001600077FD8095982F0E94B1018091710160E028 | ||
:100170000E94350208958091710161E00E9435026C | ||
:100180002091730130917401B901660F771F620FDE | ||
:10019000731F882777FD8095982F0E94B101809169 | ||
:1001A000710160E00E94350208958D3219F40E94B9 | ||
:1001B000BB0002C00E94A6000E949B000895CF923F | ||
:1001C000DF92EF92FF920F931F93CF93DF936C0117 | ||
:1001D000EE24FF242BC0F601EE0DFF1DE081E0327E | ||
:1001E00019F40E9480001FC0FF27E7FDF095EE0F75 | ||
:1001F000FF1FED50FF4F00811181C0E0D0E007C02C | ||
:10020000F801EC0FFD1F80810E94D5002196F801B6 | ||
:1002100001900020E9F73197E01BF10BCE17DF07C3 | ||
:1002200078F30E948B000894E11CF11CF601019008 | ||
:100230000020E9F73197EC19FD09EE16FF0658F298 | ||
:10024000DF91CF911F910F91FF90EF90DF90CF90B2 | ||
:10025000089580E091E00E94DF0068E873E180E0AB | ||
:1002600090E00E94B10108958091710161E00E94C7 | ||
:10027000150208950E94DB010E9434010E942901A9 | ||
:10028000FDCF1F920F920FB60F9211242F938F93D1 | ||
:100290009F93AF93BF938091AA019091AB01A091DE | ||
:1002A000AC01B091AD010196A11DB11D8093AA01D1 | ||
:1002B0009093AB01A093AC01B093AD018091AE01DE | ||
:1002C0009091AF01A091B001B091B1018050904CDC | ||
:1002D000AF4FBF4F8093AE019093AF01A093B00199 | ||
:1002E000B093B10127C08091AE019091AF01A09170 | ||
:1002F000B001B091B10180589E43A040B0408093BE | ||
:10030000AE019093AF01A093B001B093B101809181 | ||
:10031000B2019091B301A091B401B091B5010196E1 | ||
:10032000A11DB11D8093B2019093B301A093B401BC | ||
:10033000B093B5018091AE019091AF01A091B00151 | ||
:10034000B091B10181589E43A040B04060F6BF918A | ||
:10035000AF919F918F912F910F900FBE0F901F9093 | ||
:100360001895EF92FF920F931F937B018C018FB72B | ||
:10037000F8944091B2015091B3016091B401709131 | ||
:10038000B5018FBF2FB7F8948091B2019091B3015E | ||
:10039000A091B401B091B5012FBF841B950BA60BA2 | ||
:1003A000B70BE816F9060A071B0760F71F910F91B4 | ||
:1003B000FF90EF900895789484B5826084BD84B5F1 | ||
:1003C000816084BD85B5826085BD85B5816085BD50 | ||
:1003D000EEE6F0E0808181608083E1E8F0E08081FA | ||
:1003E00082608083808181608083E0E8F0E08081AA | ||
:1003F00081608083E1EBF0E0808184608083E0EBCA | ||
:10040000F0E0808181608083EAE7F0E080818460B1 | ||
:10041000808380818260808380818160808380810D | ||
:10042000806880831092C1000895282F30E0C901B0 | ||
:1004300086569F4FFC0194912A573F4FF9018491B2 | ||
:10044000882391F0E82FF0E0EE0FFF1FE859FF4FEF | ||
:10045000A591B491662329F48C91909589238C936E | ||
:1004600008958C91892B8C930895482F50E0CA01F0 | ||
:1004700082559F4FFC012491CA0186569F4FFC0173 | ||
:1004800094914A575F4FFA0134913323D1F12223DB | ||
:1004900031F1233021F4809180008F7705C0243022 | ||
:1004A00031F4809180008F7D8093800018C02130CE | ||
:1004B00019F484B58F7704C0223021F484B58F7D80 | ||
:1004C00084BD0DC0263021F48091B0008F7705C027 | ||
:1004D000273029F48091B0008F7D8093B000E32F06 | ||
:1004E000F0E0EE0FFF1FEE58FF4FA591B491662389 | ||
:1004F00029F48C91909589238C9308958C91892B64 | ||
:080500008C930895F894FFCFDD | ||
:10050800534F53002E2D002D2E2E2E002D2E2D2E26 | ||
:10051800002D2E2E002E002E2E2D2E002D2D2E00DD | ||
:100528002E2E2E2E002E2E002E2D2D2D002E2D2E71 | ||
:100538002D002E2D2E2E002D2D002D2E002D2D2D93 | ||
:10054800002E2D2D2E002D2D2E2D002E2D2E002E81 | ||
:100558002E2E002D002E2E2D002E2E2E2D002E2D6F | ||
:100568002D002D2E2E2D002D2E2D2D002D2D2E2E35 | ||
:10057800000D002C01040107010C011101150117E0 | ||
:10058800011C012001250128012D01320137013A02 | ||
:10059800013D01410146014B014F015301550159EC | ||
:0A05A800015E01620167016C0100B1 | ||
:00000001FF |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
|
||
int ledPin = 13; // LED connected to digital pin 13 | ||
int length = 300; // Unit length in miliseconds | ||
|
||
char* lookup[] = { | ||
".-", | ||
"-...", | ||
"-.-.", | ||
"-..", | ||
".", | ||
"..-.", | ||
"--.", | ||
"....", | ||
"..", | ||
".---", | ||
".-.-", | ||
".-..", | ||
"--", | ||
"-.", | ||
"---", | ||
".--.", | ||
"--.-", | ||
".-.", | ||
"...", | ||
"-" , | ||
"..-" , | ||
"...-", | ||
".--" , | ||
"-..-", | ||
"-.--", | ||
"--.." | ||
}; | ||
|
||
void setup() { | ||
pinMode(ledPin, OUTPUT); // sets the digital pin as output | ||
} | ||
|
||
|
||
void long_mark() { | ||
digitalWrite(ledPin, HIGH); | ||
delay(length*3); | ||
digitalWrite(ledPin, LOW); | ||
} | ||
|
||
void short_mark() { | ||
digitalWrite(ledPin, HIGH); | ||
delay(length); | ||
digitalWrite(ledPin, LOW); | ||
} | ||
|
||
void intra_char_gap() { | ||
delay(length); | ||
} | ||
|
||
void char_gap() { | ||
delay(length*3); | ||
} | ||
|
||
void word_gap() { | ||
delay(length); | ||
} | ||
|
||
void blink_char(char c) { | ||
if(c == '-') | ||
long_mark(); | ||
else | ||
short_mark(); | ||
intra_char_gap(); | ||
} | ||
|
||
void blink(char str[]) { | ||
int c; | ||
int ic; | ||
for(c=0; c<strlen(str); c++) { | ||
if(str[c] == ' ') | ||
word_gap(); | ||
else { | ||
int idx = (int)str[c] - 65; | ||
char* chr = lookup[idx]; | ||
for(ic=0; ic<strlen(chr); ic++) { | ||
blink_char(chr[ic]); | ||
} | ||
char_gap(); | ||
} | ||
} | ||
} | ||
|
||
void loop() { | ||
blink("SOS"); | ||
delay(5000); | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.