![](/media/cache/profiles/8757150decbd89b0f5442ca3db4d0e0e.50x50_q85.jpg)
John's code modified for envelope shaping and different colours
Fork of Morse-buddy-JohnF by
Goodies.cpp@0:8c725fbd8e0e, 2013-06-22 (annotated)
- Committer:
- tony1tf
- Date:
- Sat Jun 22 21:52:12 2013 +0000
- Revision:
- 0:8c725fbd8e0e
Random morse code practice at 4 different speeds. Written by John Fisher and published on the AQRP Yahoo group.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tony1tf | 0:8c725fbd8e0e | 1 | |
tony1tf | 0:8c725fbd8e0e | 2 | //============================================================== |
tony1tf | 0:8c725fbd8e0e | 3 | // Goodies July 7, 2011 John H. Fisher - K5JHF |
tony1tf | 0:8c725fbd8e0e | 4 | //============================================================== |
tony1tf | 0:8c725fbd8e0e | 5 | |
tony1tf | 0:8c725fbd8e0e | 6 | //#include <WProgram.h> |
tony1tf | 0:8c725fbd8e0e | 7 | |
tony1tf | 0:8c725fbd8e0e | 8 | #include "Goodies.h" |
tony1tf | 0:8c725fbd8e0e | 9 | |
tony1tf | 0:8c725fbd8e0e | 10 | //============================================================== |
tony1tf | 0:8c725fbd8e0e | 11 | |
tony1tf | 0:8c725fbd8e0e | 12 | void Goodies::Adjust ( int *value, int delta, int limit ) { |
tony1tf | 0:8c725fbd8e0e | 13 | |
tony1tf | 0:8c725fbd8e0e | 14 | int temp; |
tony1tf | 0:8c725fbd8e0e | 15 | |
tony1tf | 0:8c725fbd8e0e | 16 | if ( delta == 0 ) return; |
tony1tf | 0:8c725fbd8e0e | 17 | |
tony1tf | 0:8c725fbd8e0e | 18 | temp = *value + delta; |
tony1tf | 0:8c725fbd8e0e | 19 | |
tony1tf | 0:8c725fbd8e0e | 20 | if ( delta > 0 ) { |
tony1tf | 0:8c725fbd8e0e | 21 | |
tony1tf | 0:8c725fbd8e0e | 22 | if ( temp < limit ) *value = temp; |
tony1tf | 0:8c725fbd8e0e | 23 | |
tony1tf | 0:8c725fbd8e0e | 24 | else *value = limit; |
tony1tf | 0:8c725fbd8e0e | 25 | |
tony1tf | 0:8c725fbd8e0e | 26 | } |
tony1tf | 0:8c725fbd8e0e | 27 | |
tony1tf | 0:8c725fbd8e0e | 28 | else { |
tony1tf | 0:8c725fbd8e0e | 29 | |
tony1tf | 0:8c725fbd8e0e | 30 | if ( temp > limit ) *value = temp; |
tony1tf | 0:8c725fbd8e0e | 31 | |
tony1tf | 0:8c725fbd8e0e | 32 | else *value = limit; |
tony1tf | 0:8c725fbd8e0e | 33 | |
tony1tf | 0:8c725fbd8e0e | 34 | } |
tony1tf | 0:8c725fbd8e0e | 35 | |
tony1tf | 0:8c725fbd8e0e | 36 | } |
tony1tf | 0:8c725fbd8e0e | 37 | |
tony1tf | 0:8c725fbd8e0e | 38 | //============================================================== |
tony1tf | 0:8c725fbd8e0e | 39 | |
tony1tf | 0:8c725fbd8e0e | 40 | void Goodies::Adjust ( float *value, float delta, float limit ) { |
tony1tf | 0:8c725fbd8e0e | 41 | |
tony1tf | 0:8c725fbd8e0e | 42 | float temp; |
tony1tf | 0:8c725fbd8e0e | 43 | |
tony1tf | 0:8c725fbd8e0e | 44 | if ( delta == 0 ) return; |
tony1tf | 0:8c725fbd8e0e | 45 | |
tony1tf | 0:8c725fbd8e0e | 46 | temp = *value + delta; |
tony1tf | 0:8c725fbd8e0e | 47 | |
tony1tf | 0:8c725fbd8e0e | 48 | if ( delta > 0 ) { |
tony1tf | 0:8c725fbd8e0e | 49 | |
tony1tf | 0:8c725fbd8e0e | 50 | if ( temp < limit ) *value = temp; |
tony1tf | 0:8c725fbd8e0e | 51 | |
tony1tf | 0:8c725fbd8e0e | 52 | else *value = limit; |
tony1tf | 0:8c725fbd8e0e | 53 | |
tony1tf | 0:8c725fbd8e0e | 54 | } |
tony1tf | 0:8c725fbd8e0e | 55 | |
tony1tf | 0:8c725fbd8e0e | 56 | else { |
tony1tf | 0:8c725fbd8e0e | 57 | |
tony1tf | 0:8c725fbd8e0e | 58 | if ( temp > limit ) *value = temp; |
tony1tf | 0:8c725fbd8e0e | 59 | |
tony1tf | 0:8c725fbd8e0e | 60 | else *value = limit; |
tony1tf | 0:8c725fbd8e0e | 61 | |
tony1tf | 0:8c725fbd8e0e | 62 | } |
tony1tf | 0:8c725fbd8e0e | 63 | |
tony1tf | 0:8c725fbd8e0e | 64 | } |
tony1tf | 0:8c725fbd8e0e | 65 | |
tony1tf | 0:8c725fbd8e0e | 66 | //============================================================== |
tony1tf | 0:8c725fbd8e0e | 67 | |
tony1tf | 0:8c725fbd8e0e | 68 |