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-19
- Revision:
- 8:60231840370f
- Parent:
- 7:98bccc314b54
File content as of revision 8:60231840370f:
#include "math.h"
class Note {
public:
Note(int frequency, bool hasDiesis, int* octaveRegister, bool* diesisRegister): _frequency(frequency), _diesis(hasDiesis), oReg(octaveRegister), dReg(diesisRegister){
}
double getFrequency(){
double result = _frequency*pow (2.0, *(oReg));
if (_diesis&&(*dReg))
result*=1.0594630943593;//pow(2.0,1/12);
return result;
}
private:
int _frequency;
bool _diesis;
int* oReg;
bool* dReg;
};
