
elec350
Fork of elec350 by
microphone.h@12:ae626e46b996, 2015-10-21 (annotated)
- Committer:
- rmerrisonhort
- Date:
- Wed Oct 21 22:42:17 2015 +0000
- Revision:
- 12:ae626e46b996
- Parent:
- 10:021f19a9861f
Updated soft_pwm to make it a bit clearer.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rmerrisonhort | 9:3801e1da153b | 1 | #ifndef _MICROPHONE_H_ |
rmerrisonhort | 9:3801e1da153b | 2 | #define _MICROPHONE_H_ |
rmerrisonhort | 9:3801e1da153b | 3 | |
rmerrisonhort | 9:3801e1da153b | 4 | #include "mbed.h" |
rmerrisonhort | 9:3801e1da153b | 5 | |
rmerrisonhort | 9:3801e1da153b | 6 | class Microphone |
rmerrisonhort | 9:3801e1da153b | 7 | { |
rmerrisonhort | 9:3801e1da153b | 8 | private: |
rmerrisonhort | 9:3801e1da153b | 9 | bool isStarted; |
rmerrisonhort | 9:3801e1da153b | 10 | public: |
rmerrisonhort | 10:021f19a9861f | 11 | // Constructor. |
rmerrisonhort | 9:3801e1da153b | 12 | Microphone(); |
rmerrisonhort | 10:021f19a9861f | 13 | |
rmerrisonhort | 10:021f19a9861f | 14 | // Begins sampling data from the microphone using timer 3. |
rmerrisonhort | 9:3801e1da153b | 15 | void start(); |
rmerrisonhort | 10:021f19a9861f | 16 | |
rmerrisonhort | 10:021f19a9861f | 17 | // Ends sampling (UNTESTED!) |
rmerrisonhort | 9:3801e1da153b | 18 | void stop(); |
rmerrisonhort | 10:021f19a9861f | 19 | |
rmerrisonhort | 10:021f19a9861f | 20 | // Returns a signed 8-bit integer containing the latest data from the microphone. |
rmerrisonhort | 9:3801e1da153b | 21 | int8_t read(); |
rmerrisonhort | 9:3801e1da153b | 22 | }; |
rmerrisonhort | 9:3801e1da153b | 23 | |
rmerrisonhort | 12:ae626e46b996 | 24 | #endif |