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 mbed-rtos 4180Final SDFileSystem
microphone.h@0:c5d6f214ba01, 2020-04-26 (annotated)
- Committer:
- William12
- Date:
- Sun Apr 26 06:56:36 2020 +0000
- Revision:
- 0:c5d6f214ba01
- Child:
- 1:e14104308237
stuff
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
William12 | 0:c5d6f214ba01 | 1 | #include "mbed.h" |
William12 | 0:c5d6f214ba01 | 2 | |
William12 | 0:c5d6f214ba01 | 3 | class microphone |
William12 | 0:c5d6f214ba01 | 4 | { |
William12 | 0:c5d6f214ba01 | 5 | public : |
William12 | 0:c5d6f214ba01 | 6 | microphone(PinName pin); |
William12 | 0:c5d6f214ba01 | 7 | float read(); |
William12 | 0:c5d6f214ba01 | 8 | operator float (); |
William12 | 0:c5d6f214ba01 | 9 | private : |
William12 | 0:c5d6f214ba01 | 10 | AnalogIn _pin; |
William12 | 0:c5d6f214ba01 | 11 | }; |
William12 | 0:c5d6f214ba01 | 12 | microphone::microphone (PinName pin): |
William12 | 0:c5d6f214ba01 | 13 | _pin(pin) |
William12 | 0:c5d6f214ba01 | 14 | { |
William12 | 0:c5d6f214ba01 | 15 | } |
William12 | 0:c5d6f214ba01 | 16 | float microphone::read() |
William12 | 0:c5d6f214ba01 | 17 | { |
William12 | 0:c5d6f214ba01 | 18 | return _pin.read(); |
William12 | 0:c5d6f214ba01 | 19 | } |
William12 | 0:c5d6f214ba01 | 20 | inline microphone::operator float () |
William12 | 0:c5d6f214ba01 | 21 | { |
William12 | 0:c5d6f214ba01 | 22 | return _pin.read(); |
William12 | 0:c5d6f214ba01 | 23 | } |