satbir panesar
/
elec350
my library for elec350
microphone.h@3:d62097c19a4e, 2016-10-19 (annotated)
- Committer:
- spanesar
- Date:
- Wed Oct 19 20:33:20 2016 +0000
- Revision:
- 3:d62097c19a4e
added microphone files;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
spanesar | 3:d62097c19a4e | 1 | #ifndef _MICROPHONE_H_ |
spanesar | 3:d62097c19a4e | 2 | #define _MICROPHONE_H_ |
spanesar | 3:d62097c19a4e | 3 | |
spanesar | 3:d62097c19a4e | 4 | #include "mbed.h" |
spanesar | 3:d62097c19a4e | 5 | |
spanesar | 3:d62097c19a4e | 6 | class Microphone |
spanesar | 3:d62097c19a4e | 7 | { |
spanesar | 3:d62097c19a4e | 8 | private: |
spanesar | 3:d62097c19a4e | 9 | bool isStarted; |
spanesar | 3:d62097c19a4e | 10 | public: |
spanesar | 3:d62097c19a4e | 11 | // Constructor. |
spanesar | 3:d62097c19a4e | 12 | Microphone(); |
spanesar | 3:d62097c19a4e | 13 | |
spanesar | 3:d62097c19a4e | 14 | // Begins sampling data from the microphone using timer 3. |
spanesar | 3:d62097c19a4e | 15 | void start(); |
spanesar | 3:d62097c19a4e | 16 | |
spanesar | 3:d62097c19a4e | 17 | // Ends sampling (UNTESTED!) |
spanesar | 3:d62097c19a4e | 18 | void stop(); |
spanesar | 3:d62097c19a4e | 19 | |
spanesar | 3:d62097c19a4e | 20 | // Returns a signed 8-bit integer containing the latest data from the microphone. |
spanesar | 3:d62097c19a4e | 21 | signed char read(); |
spanesar | 3:d62097c19a4e | 22 | }; |
spanesar | 3:d62097c19a4e | 23 | |
spanesar | 3:d62097c19a4e | 24 | #endif |