
Very simple frequency program that assigns a frequency to a note
Revision 0:76182452ce7f, committed 2015-11-30
- Comitter:
- taptoneesarm
- Date:
- Mon Nov 30 16:24:50 2015 +0000
- Commit message:
- Really simple frequency program
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 76182452ce7f main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Nov 30 16:24:50 2015 +0000 @@ -0,0 +1,27 @@ +// The mBed interprets an alternating +// current as a result of detected frequency +// from the pickup/piezo from a played chord[input] + +// The mBed then devises an output as +// a pattern of LED lights to indicate +// the given chord [output] + +#include "mbed.h" +#include <cstdio> +#include <cstdlib> +#include <iostream> +DigitalOut myled(LED1); + +int main(int nNumberofArgs, char* pszArgs[]) { + int freq; + string actualFreq; + cout << "Enter a frequency in kilohertz" << endl; + cin >> freq; + if (-0.5<(16.35 - freq)<0.5); + { + actualFreq = "C0"; + } + cout << "Your chord is " << actualFreq; + cout << "Press Enter to continue" << endl; + return.0; +}
diff -r 000000000000 -r 76182452ce7f mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Nov 30 16:24:50 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/165afa46840b \ No newline at end of file