Setting up a construct for playing morse code
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
void playLetter(char x) | |
{ | |
switch (x): | |
case 'E': | |
dit(); return; | |
case 'T': | |
dah(); return; | |
case 'A': | |
di();dah(); return; | |
case 'O': | |
dah();dah();dah(); return; | |
/*Insert more alphabets here*/ | |
case ' ': | |
delay(wordSpace); | |
/* We've inserted the wordSpace delay to make sure it relaxes when the letter is a space */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment