![](/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
- Committer:
- tony1tf
- Date:
- 2013-06-22
- Revision:
- 0:8c725fbd8e0e
File content as of revision 0:8c725fbd8e0e:
//============================================================== // Goodies July 7, 2011 John H. Fisher - K5JHF //============================================================== //#include <WProgram.h> #include "Goodies.h" //============================================================== void Goodies::Adjust ( int *value, int delta, int limit ) { int temp; if ( delta == 0 ) return; temp = *value + delta; if ( delta > 0 ) { if ( temp < limit ) *value = temp; else *value = limit; } else { if ( temp > limit ) *value = temp; else *value = limit; } } //============================================================== void Goodies::Adjust ( float *value, float delta, float limit ) { float temp; if ( delta == 0 ) return; temp = *value + delta; if ( delta > 0 ) { if ( temp < limit ) *value = temp; else *value = limit; } else { if ( temp > limit ) *value = temp; else *value = limit; } } //==============================================================