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
Note.cpp
- Committer:
- mfurlanetto
- Date:
- 2015-09-18
- Revision:
- 7:98bccc314b54
- Child:
- 8:60231840370f
File content as of revision 7:98bccc314b54:
#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; };