
This hello world utilizes the basic functions setup in the MAX4466 library to indicate volume levels read from the microphone using the 4 LEDs built in to the MBED
main.cpp@1:c5772cef09bc, 2015-10-23 (annotated)
- Committer:
- mgolino
- Date:
- Fri Oct 23 18:39:14 2015 +0000
- Revision:
- 1:c5772cef09bc
- Parent:
- 0:fc5acbf5061c
None
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mgolino | 0:fc5acbf5061c | 1 | #include "mbed.h" |
mgolino | 0:fc5acbf5061c | 2 | #include "MAX4466.h" |
mgolino | 0:fc5acbf5061c | 3 | Serial pc (USBTX, USBRX); |
mgolino | 0:fc5acbf5061c | 4 | |
mgolino | 0:fc5acbf5061c | 5 | |
mgolino | 0:fc5acbf5061c | 6 | MAX4466 mic(p20); |
mgolino | 0:fc5acbf5061c | 7 | |
mgolino | 0:fc5acbf5061c | 8 | int main() |
mgolino | 0:fc5acbf5061c | 9 | { |
mgolino | 0:fc5acbf5061c | 10 | while (1) { |
mgolino | 0:fc5acbf5061c | 11 | mic.volume_indicator(); |
mgolino | 0:fc5acbf5061c | 12 | pc.printf("\n\r Level is %f", mic.sound_level()); |
mgolino | 0:fc5acbf5061c | 13 | } |
mgolino | 0:fc5acbf5061c | 14 | } |