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: mbed
main.cpp@0:4646e91ee22c, 2018-12-05 (annotated)
- Committer:
- tani_n
- Date:
- Wed Dec 05 02:09:47 2018 +0000
- Revision:
- 0:4646e91ee22c
WSN-tani
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tani_n | 0:4646e91ee22c | 1 | #include "mbed.h" |
tani_n | 0:4646e91ee22c | 2 | Serial xbe1(dp16, dp15); |
tani_n | 0:4646e91ee22c | 3 | DigitalOut myled(LED1); |
tani_n | 0:4646e91ee22c | 4 | Serial pc(USBTX, USBRX); |
tani_n | 0:4646e91ee22c | 5 | AnalogIn analog_value(dp13); |
tani_n | 0:4646e91ee22c | 6 | |
tani_n | 0:4646e91ee22c | 7 | int main() { |
tani_n | 0:4646e91ee22c | 8 | float meas, temp; |
tani_n | 0:4646e91ee22c | 9 | |
tani_n | 0:4646e91ee22c | 10 | int count=0; |
tani_n | 0:4646e91ee22c | 11 | myled=0; |
tani_n | 0:4646e91ee22c | 12 | while(1){ |
tani_n | 0:4646e91ee22c | 13 | meas=analog_value.read(); |
tani_n | 0:4646e91ee22c | 14 | meas=meas*3300; |
tani_n | 0:4646e91ee22c | 15 | temp=0.1*meas-50; |
tani_n | 0:4646e91ee22c | 16 | |
tani_n | 0:4646e91ee22c | 17 | myled=0; |
tani_n | 0:4646e91ee22c | 18 | xbe1.printf("40D7B70A> %d: temp = %.1f C\r\n", count++, temp); |
tani_n | 0:4646e91ee22c | 19 | wait_ms(1000); |
tani_n | 0:4646e91ee22c | 20 | myled=1; |
tani_n | 0:4646e91ee22c | 21 | } |
tani_n | 0:4646e91ee22c | 22 | } |