I was bored a few days ago and then remembered that I have a piezo buzzer and LEDs. So an idea came to my mind to make a morse code translator with the catch that it translates anything that's inputted into the serial monitor.
(The project is on Crotian so I added a translation at the bottom of this description,plus - my arduino is a Croduino, it's basically an Arduino Nano but the program should work just fine on any arduino board)
Firstly I predefined buzzer commands, then used them to program every letter from the english alphabet in Morse code (dots and dashes).
Then the main part of the program uses a For loop to spit out every letter from the ser. mon. and check which one is it, if it corresponds to a letter from the "text to morse" part of the program it will display its Morse counterpart on the monitor and beep in the correct order.
Once it sees that the counter (i) exceeded the number of letters from your message, the program is done and lets you write again, and again, and again.
slovo = letter
ton = tone
crta = dash
tocka = dot
pauza = pause
kraj = end
abeceda = alphabet
poruka_u_morse = message_to_morse
spiker = buzzer/speaker
poruka = message
Comments