Since I’m waiting for circuit boards for OpenBeacon Mini to arrive, I want to keep the waiting time as productive as possible, so I’ve been working on the firmware. Specifically, one of my recent goals was to factor all of the modulation code out of the spaghetti mess that is the current state of the OpenBeacon 2 firmware (which is my starting point for OpenBeacon Mini).
In that vein, today I managed to finish up work on release v1.0.0 of the Etherkit Morse Arduino library. The majority of the coding work was done during my last few Twitch livestreams, so other than tweaking and cleaning up the code, most of the work today consisted of creating documentation and getting the repository in shape to be a proper Arduino library.
The way that this library functions is quite simple. Since timing in Morse code sending is critical, the end user of the library is required to provide a function that calls the library’s update method every one millisecond. This type of interface was chosen so that the library can be platform agnostic (since Arduinos come with different microcontrollers which have totally different timer functions). An transmit output pin and speed in words per minute is specified when the class in instantiated, and then all you have to do is call the class’s send method to send Morse code on the digital output pin. Alternately, you can have your sketch poll the class’s tx variable and act on it accordingly. Pretty easy stuff.
I’ve put in a request for the library to be included in the official Arduino Library Manager, so if you want to give it a try, wait a day or so for it to be listed there. If you really can’t wait, there are instructions in the README about how to manually install it. Hopefully you find it useful, and as always, please file your bug reports and suggestions for improvements as an issue on GitHub. Thanks!