Fixed to work with paper potentiometer

Dependencies:   mbed

main.cpp

Committer:
ziadeldebri
Date:
2017-10-06
Revision:
1:d16782f51626
Parent:
0:dcdfee042939

File content as of revision 1:d16782f51626:

#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(D3);
 
    while (true) {
        //myMusic.playNote(int(readValue.read()));
        myMusic.playNote(readVoltage.read()*80.f);
    }//end of while
}//end of main