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@0:a84ca5aea16f, 2015-05-11 (annotated)
- Committer:
- mbed_Cookbook_SE
- Date:
- Mon May 11 10:11:11 2015 +0000
- Revision:
- 0:a84ca5aea16f
- Child:
- 1:758a4ce77b97
????????????????
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 | 0:a84ca5aea16f | 2 | |
mbed_Cookbook_SE | 0:a84ca5aea16f | 3 | AnalogIn sensor(dp13); |
mbed_Cookbook_SE | 0:a84ca5aea16f | 4 | Serial pc(USBTX, USBRX); |
mbed_Cookbook_SE | 0:a84ca5aea16f | 5 | |
mbed_Cookbook_SE | 0:a84ca5aea16f | 6 | int main() { |
mbed_Cookbook_SE | 0:a84ca5aea16f | 7 | while(1) { |
mbed_Cookbook_SE | 0:a84ca5aea16f | 8 | float Temperature; |
mbed_Cookbook_SE | 0:a84ca5aea16f | 9 | |
mbed_Cookbook_SE | 0:a84ca5aea16f | 10 | Temperature = (sensor * 3.3 - 0.6) / 0.01; |
mbed_Cookbook_SE | 0:a84ca5aea16f | 11 | |
mbed_Cookbook_SE | 0:a84ca5aea16f | 12 | pc.printf("Temperature = %f\r\n",Temperature); |
mbed_Cookbook_SE | 0:a84ca5aea16f | 13 | |
mbed_Cookbook_SE | 0:a84ca5aea16f | 14 | wait(1.0); |
mbed_Cookbook_SE | 0:a84ca5aea16f | 15 | } |
mbed_Cookbook_SE | 0:a84ca5aea16f | 16 | } |