my library for elec350
Diff: microphone.h
- Revision:
- 3:d62097c19a4e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/microphone.h Wed Oct 19 20:33:20 2016 +0000
@@ -0,0 +1,24 @@
+#ifndef _MICROPHONE_H_
+#define _MICROPHONE_H_
+
+#include "mbed.h"
+
+class Microphone
+{
+ private:
+ bool isStarted;
+ public:
+ // Constructor.
+ Microphone();
+
+ // Begins sampling data from the microphone using timer 3.
+ void start();
+
+ // Ends sampling (UNTESTED!)
+ void stop();
+
+ // Returns a signed 8-bit integer containing the latest data from the microphone.
+ signed char read();
+};
+
+#endif