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.
main.cpp@0:25a48958f7b8, 2017-09-28 (annotated)
- Committer:
- SMART_CLEO
- Date:
- Thu Sep 28 03:27:05 2017 +0000
- Revision:
- 0:25a48958f7b8
SMART_CLEO
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| SMART_CLEO | 0:25a48958f7b8 | 1 | #include "mbed.h" |
| SMART_CLEO | 0:25a48958f7b8 | 2 | #include "TextLCD.h" |
| SMART_CLEO | 0:25a48958f7b8 | 3 | |
| SMART_CLEO | 0:25a48958f7b8 | 4 | PinName pin_SOUND = PC_3; |
| SMART_CLEO | 0:25a48958f7b8 | 5 | |
| SMART_CLEO | 0:25a48958f7b8 | 6 | AnalogIn adc_SOUND(pin_SOUND); |
| SMART_CLEO | 0:25a48958f7b8 | 7 | |
| SMART_CLEO | 0:25a48958f7b8 | 8 | // rs, rw, e, d0-d3 |
| SMART_CLEO | 0:25a48958f7b8 | 9 | TextLCD lcd(PB_12, PB_13, PB_14, PB_15, PA_9, PA_10, PA_11); |
| SMART_CLEO | 0:25a48958f7b8 | 10 | |
| SMART_CLEO | 0:25a48958f7b8 | 11 | int main() { |
| SMART_CLEO | 0:25a48958f7b8 | 12 | |
| SMART_CLEO | 0:25a48958f7b8 | 13 | int volt; |
| SMART_CLEO | 0:25a48958f7b8 | 14 | lcd.printf(" SOUND Program\n"); |
| SMART_CLEO | 0:25a48958f7b8 | 15 | lcd.printf(" Volt : [mV]"); |
| SMART_CLEO | 0:25a48958f7b8 | 16 | while(1) { |
| SMART_CLEO | 0:25a48958f7b8 | 17 | volt = adc_SOUND.read()*3300; |
| SMART_CLEO | 0:25a48958f7b8 | 18 | lcd.locate(8, 1); |
| SMART_CLEO | 0:25a48958f7b8 | 19 | lcd.printf("%4d", volt); |
| SMART_CLEO | 0:25a48958f7b8 | 20 | wait(0.5); |
| SMART_CLEO | 0:25a48958f7b8 | 21 | } |
| SMART_CLEO | 0:25a48958f7b8 | 22 | } |