Fixed to work with paper potentiometer
Dependencies: mbed
main.cpp
- Committer:
- halea
- Date:
- 2016-09-19
- Revision:
- 0:dcdfee042939
- Child:
- 1:d16782f51626
File content as of revision 0:dcdfee042939:
#include "mbed.h" #include "Music.h" #include "AnalogIn.h" /*! Main class. * Creates an instance of the Music class, and then connects it to an output, which should * be connected to a small speaker. * \author Alex Hale * * \date August 14th, 2016 */ //#define STARTING_NOTE 80 AnalogIn readVoltage(A0); //DigitalOut mySpeaker(D0); int main() { Music myMusic(D0); while (true) { //myMusic.playNote(int(readValue.read())); myMusic.playNote(readVoltage.read()*80.f); }//end of while }//end of main