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: SB1602E SDFileSystem mbed
main.cpp@1:758a4ce77b97, 2015-05-15 (annotated)
- Committer:
- mbed_Cookbook_SE
- Date:
- Fri May 15 05:40:12 2015 +0000
- Revision:
- 1:758a4ce77b97
- Parent:
- 0:a84ca5aea16f
- Child:
- 2:78ba5d3f0ac9
???????????????
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| mbed_Cookbook_SE | 0:a84ca5aea16f | 1 | #include "mbed.h" |
| mbed_Cookbook_SE | 1:758a4ce77b97 | 2 | #include "SB1602E.h" |
| mbed_Cookbook_SE | 0:a84ca5aea16f | 3 | |
| mbed_Cookbook_SE | 0:a84ca5aea16f | 4 | AnalogIn sensor(dp13); |
| mbed_Cookbook_SE | 0:a84ca5aea16f | 5 | Serial pc(USBTX, USBRX); |
| mbed_Cookbook_SE | 1:758a4ce77b97 | 6 | SB1602E lcd( dp5, dp27 ); |
| mbed_Cookbook_SE | 0:a84ca5aea16f | 7 | |
| mbed_Cookbook_SE | 0:a84ca5aea16f | 8 | int main() { |
| mbed_Cookbook_SE | 1:758a4ce77b97 | 9 | lcd.contrast(0x30); |
| mbed_Cookbook_SE | 0:a84ca5aea16f | 10 | while(1) { |
| mbed_Cookbook_SE | 0:a84ca5aea16f | 11 | float Temperature; |
| mbed_Cookbook_SE | 0:a84ca5aea16f | 12 | |
| mbed_Cookbook_SE | 0:a84ca5aea16f | 13 | Temperature = (sensor * 3.3 - 0.6) / 0.01; |
| mbed_Cookbook_SE | 0:a84ca5aea16f | 14 | |
| mbed_Cookbook_SE | 0:a84ca5aea16f | 15 | pc.printf("Temperature = %f\r\n",Temperature); |
| mbed_Cookbook_SE | 1:758a4ce77b97 | 16 | |
| mbed_Cookbook_SE | 1:758a4ce77b97 | 17 | lcd.clear(); |
| mbed_Cookbook_SE | 1:758a4ce77b97 | 18 | lcd.printf(0,0,"%.2f",Temperature); |
| mbed_Cookbook_SE | 0:a84ca5aea16f | 19 | |
| mbed_Cookbook_SE | 0:a84ca5aea16f | 20 | wait(1.0); |
| mbed_Cookbook_SE | 0:a84ca5aea16f | 21 | } |
| mbed_Cookbook_SE | 0:a84ca5aea16f | 22 | } |