Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit 8845759

Browse files
committed
finished morse mapping
1 parent f5d60d5 commit 8845759

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

examples/FirebaseMorse_ESP8266/FirebaseMorse_ESP8266.ino

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
// is 5 morse elements long so we would have a sparse array of 2^5=32. But
3131
// we need to add a leading 1 to ensure that .- and ..- are not the same value.
3232
// This gives us a size of 2^6=64.
33-
char morseToChar[64];
33+
char morseToChar[64] = {};
3434
morseToChar[B101] = 'a';
3535
morseToChar[B11000] = 'b';
3636
morseToChar[B11010] = 'c';
@@ -43,7 +43,29 @@ morseToChar[B100] = 'i';
4343
morseToChar[B1101] = 'k';
4444
morseToChar[B10100] = 'l';
4545
morseToChar[B111] = 'm';
46-
morseToChar[B1
46+
morseToChar[B110] = 'n';
47+
morseToChar[B1111] = 'o';
48+
morseToChar[B10110] = 'p';
49+
morseToChar[B11101] = 'q';
50+
morseToChar[B1010] = 'r';
51+
morseToChar[B1000] = 's';
52+
morseToChar[B11] = 't';
53+
morseToChar[B1001] = 'u';
54+
morseToChar[B10001] = 'v';
55+
morseToChar[B1011] = 'w';
56+
morseToChar[B11001] = 'x';
57+
morseToChar[B11011] = 'y';
58+
morseToChar[B11100] = 'z';
59+
morseToChar[B101111] = '1';
60+
morseToChar[B100111] = '2';
61+
morseToChar[B100011] = '3';
62+
morseToChar[B100001] = '4';
63+
morseToChar[B100000] = '5';
64+
morseToChar[B110000] = '6';
65+
morseToChar[B111000] = '7';
66+
morseToChar[B111100] = '8';
67+
morseToChar[B111110] = '9';
68+
morseToChar[B111111] = '0';
4769

4870
const int oledResetPin = 3;
4971
Adafruit_SSD1306 display(oledResetPin);

0 commit comments

Comments
 (0)