Morse code encoder library
Diff: morse.cpp
- Revision:
- 2:7dc8528b23da
- Parent:
- 1:e377d081edea
- Child:
- 3:9c975c0e2342
diff -r e377d081edea -r 7dc8528b23da morse.cpp --- a/morse.cpp Sat Jul 26 22:48:52 2014 +0000 +++ b/morse.cpp Wed Aug 06 23:45:26 2014 +0000 @@ -61,10 +61,10 @@ void Morse::beep (int k) { _pwm.write(0.5); - _pin = 1; + _pout = 1; wait(cw_tick * (float)k); _pwm.write(0.0); - _pin = 0; + _pout = 0; } /** spacing function @@ -171,7 +171,7 @@ * @param f - float f, oscillation frequency (default 800Hz) */ -Morse::Morse() : _pin( LED1 ), _pwm( dp24 ) +Morse::Morse() : _pout( LED1 ), _pwm( dp24 ) { cw_tick = 0.1; freq = 800; @@ -179,7 +179,7 @@ _pwm.write(0.0); } -Morse::Morse(PinName pwm, PinName led) : _pin( led ), _pwm( pwm ) +Morse::Morse(PinName pwm, PinName led) : _pout( led ), _pwm( pwm ) { cw_tick = 0.1; freq = 800; @@ -187,7 +187,7 @@ _pwm.write(0.0); } -Morse::Morse(PinName pwm, PinName led, float t) : _pin( led ), _pwm( pwm ) +Morse::Morse(PinName pwm, PinName led, float t) : _pout( led ), _pwm( pwm ) { cw_tick = t; freq = 800; @@ -195,7 +195,7 @@ _pwm.write(0.0); } -Morse::Morse(PinName pwm, PinName led, float t, float f) : _pin( led ), _pwm( pwm ) +Morse::Morse(PinName pwm, PinName led, float t, float f) : _pout( led ), _pwm( pwm ) { cw_tick = t; freq = f;