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.
Fork of ele350 by
microphone.h@3:1ad50b4e51a6, 2015-11-05 (annotated)
- Committer:
- GGHHHH
- Date:
- Thu Nov 05 12:01:26 2015 +0000
- Revision:
- 3:1ad50b4e51a6
ku
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
GGHHHH | 3:1ad50b4e51a6 | 1 | #ifndef _MICROPHONE_H_ |
GGHHHH | 3:1ad50b4e51a6 | 2 | #define _MICROPHONE_H_ |
GGHHHH | 3:1ad50b4e51a6 | 3 | |
GGHHHH | 3:1ad50b4e51a6 | 4 | #include "mbed.h" |
GGHHHH | 3:1ad50b4e51a6 | 5 | |
GGHHHH | 3:1ad50b4e51a6 | 6 | class Microphone |
GGHHHH | 3:1ad50b4e51a6 | 7 | { |
GGHHHH | 3:1ad50b4e51a6 | 8 | private: |
GGHHHH | 3:1ad50b4e51a6 | 9 | bool isStarted; |
GGHHHH | 3:1ad50b4e51a6 | 10 | public: |
GGHHHH | 3:1ad50b4e51a6 | 11 | // Constructor. |
GGHHHH | 3:1ad50b4e51a6 | 12 | Microphone(); |
GGHHHH | 3:1ad50b4e51a6 | 13 | |
GGHHHH | 3:1ad50b4e51a6 | 14 | // Begins sampling data from the microphone using timer 3. |
GGHHHH | 3:1ad50b4e51a6 | 15 | void start(); |
GGHHHH | 3:1ad50b4e51a6 | 16 | |
GGHHHH | 3:1ad50b4e51a6 | 17 | // Ends sampling (UNTESTED!) |
GGHHHH | 3:1ad50b4e51a6 | 18 | void stop(); |
GGHHHH | 3:1ad50b4e51a6 | 19 | |
GGHHHH | 3:1ad50b4e51a6 | 20 | // Returns a signed 8-bit integer containing the latest data from the microphone. |
GGHHHH | 3:1ad50b4e51a6 | 21 | int8_t read(); |
GGHHHH | 3:1ad50b4e51a6 | 22 | }; |
GGHHHH | 3:1ad50b4e51a6 | 23 | |
GGHHHH | 3:1ad50b4e51a6 | 24 | #endif |
GGHHHH | 3:1ad50b4e51a6 | 25 |