Morse code encoder library
Revision 4:e0cc0df745ef, committed 2014-12-06
- Comitter:
- ChuckTimber
- Date:
- Sat Dec 06 00:00:53 2014 +0000
- Parent:
- 3:9c975c0e2342
- Commit message:
- Analog Synth builders summit 2014 version
Changed in this revision
morse.cpp | Show annotated file Show diff for this revision Revisions of this file |
morse.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/morse.cpp Thu Aug 07 00:15:05 2014 +0000 +++ b/morse.cpp Sat Dec 06 00:00:53 2014 +0000 @@ -1,6 +1,14 @@ #include "morse.h" #include "mbed.h" +/** + * @file morse.cpp + * Project morse code handling Library + * @brief morse code handling library for mbed + * @version 1.0 + * @author Chuck Timber + * @date 07/08/2014 + */ /** class to generate Morse code tone and keying signal. * sound with a buzzer, based on a PwmOut, * keying signal base on a DigitalOut @@ -204,6 +212,7 @@ freq = 800; _pwm.period(1.0/freq); _pwm.write(0.0); + _pout = 0; } Morse::Morse(PinName pwm, PinName led) : _pout( led ), _pwm( pwm ) @@ -212,6 +221,7 @@ freq = 800; _pwm.period(1.0/freq); _pwm.write(0.0); + _pout = 0; } Morse::Morse(PinName pwm, PinName led, float t) : _pout( led ), _pwm( pwm ) @@ -220,6 +230,7 @@ freq = 800; _pwm.period(1.0/freq); _pwm.write(0.0); + _pout = 0; } Morse::Morse(PinName pwm, PinName led, float t, float f) : _pout( led ), _pwm( pwm ) @@ -228,4 +239,5 @@ freq = f; _pwm.period(1.0/freq); _pwm.write(0.0); + _pout = 0; }
--- a/morse.h Thu Aug 07 00:15:05 2014 +0000 +++ b/morse.h Sat Dec 06 00:00:53 2014 +0000 @@ -3,8 +3,23 @@ #include "mbed.h" -/** @file - * class to generate Morse code tone and keying signal. +/** + * @file morse.h + * Project morse code handling Library + * @brief morse code handling library for mbed + * @version 1.0 + * @author Chuck Timber + * @date 07/08/2014 + */ +/** + * @file morse.cpp + * Project morse code handling Library + * @brief morse code handling library for mbed + * @version 1.0 + * @author Chuck Timber + * @date 07/08/2014 + */ +/** class to generate Morse code tone and keying signal. * sound with a buzzer, based on a PwmOut, * keying signal base on a DigitalOut * @@ -39,12 +54,13 @@ */ namespace mbed { -/* Class: Morse +/** Class: Morse * A class whitch uses pwm and digitalout to generate morse tone and signal. */ class Morse { private: + /// morse speed conversion table static const float table[128]; float cw_tick; int tick_idx;