Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: TextLCD mbed MMA8451Q TSI
Diff: Note.cpp
- Revision:
- 7:98bccc314b54
- Child:
- 8:60231840370f
diff -r 459ddd3079fa -r 98bccc314b54 Note.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Note.cpp Fri Sep 18 15:46:20 2015 +0000 @@ -0,0 +1,19 @@ +#include "math.h" +class Note { +public: + Note(int frequency, bool hasDiesis, int* octaveRegister, bool* diesisRegister): _frequency(frequency), _diesis(hasDiesis), dReg(diesisRegister), oReg(octaveRegister){ + } + + double getFrequency(){ + double result = pow (double(_frequency), *(oReg)+1); + if (_diesis&&(*dReg)) + result+=pow(2.0,1/12); + return result; + } + +private: + int _frequency; + bool _diesis; + int* oReg; + bool* dReg; +}; \ No newline at end of file