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@1:b7c052bec578, 2015-08-03 (annotated)
- Committer:
- youhinclark
- Date:
- Mon Aug 03 10:34:33 2015 +0000
- Revision:
- 1:b7c052bec578
- Parent:
- 0:d86587ed9b1c
Temperature
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| hasimo | 0:d86587ed9b1c | 1 | #include "mbed.h" |
| hasimo | 0:d86587ed9b1c | 2 | #include "TextLCD.h" |
| hasimo | 0:d86587ed9b1c | 3 | |
| hasimo | 0:d86587ed9b1c | 4 | TextLCD lcd(p24, p26, p27, p28, p29, p30); // rs, e, d4-d7 |
| hasimo | 0:d86587ed9b1c | 5 | AnalogIn ain(p15); |
| hasimo | 0:d86587ed9b1c | 6 | |
| hasimo | 0:d86587ed9b1c | 7 | int main() { |
| hasimo | 0:d86587ed9b1c | 8 | float adc; |
| hasimo | 0:d86587ed9b1c | 9 | |
| hasimo | 0:d86587ed9b1c | 10 | while (1){ |
| youhinclark | 1:b7c052bec578 | 11 | adc=ain.read(); |
| hasimo | 0:d86587ed9b1c | 12 | lcd.locate(0,0); |
| youhinclark | 1:b7c052bec578 | 13 | adc=adc*3.3*100; |
| youhinclark | 1:b7c052bec578 | 14 | lcd.printf("%8.1f \n", adc); |
| hasimo | 0:d86587ed9b1c | 15 | wait(0.05); // 20Hz update rate |
| hasimo | 0:d86587ed9b1c | 16 | } |
| hasimo | 0:d86587ed9b1c | 17 | } |