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: mbed
Diff: main.cpp
- Revision:
- 0:dcdfee042939
- Child:
- 1:d16782f51626
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Sep 19 17:19:59 2016 +0000
@@ -0,0 +1,28 @@
+#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
+
+
\ No newline at end of file