Skip to content

Commit

Permalink
added 2-param constructor to maintain backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dwu committed Aug 20, 2018
1 parent 9d69b35 commit 03dfcb7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion morse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ void LEDMorseSender::setOn() { digitalWrite(pin, activeLow ? LOW : HIGH); }
void LEDMorseSender::setOff() { digitalWrite(pin, activeLow ? HIGH : LOW); }
LEDMorseSender::LEDMorseSender(int outputPin, bool activeLow, float wpm)
: MorseSender(outputPin, wpm), activeLow(activeLow) {};

LEDMorseSender::LEDMorseSender(int outputPin, float wpm)
: MorseSender(outputPin, wpm), activeLow(false) {};

// PWMMorseSender

Expand Down
7 changes: 7 additions & 0 deletions morse.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@ class LEDMorseSender: public MorseSender {
* @param wpm words per minute, default: WPM_DEFAULT
*/
LEDMorseSender(int outputPin, bool activeLow = false, float wpm=WPM_DEFAULT);

/**
* Creates a LED Morse code sender with the given GPIO pin. This constructor is for backward compability.
* @param outputPin GPIO pin number
* @param wpm words per minute
*/
LEDMorseSender(int outputPin, float wpm);
};


Expand Down

0 comments on commit 03dfcb7

Please sign in to comment.