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.
main6_2.cpp
- Committer:
- esemi00
- Date:
- 2021-01-20
- Revision:
- 0:ec16c632d97f
File content as of revision 0:ec16c632d97f:
//プログラム6_2 main6_2.cpp
#include "mbed.h"
Serial pc(USBTX, USBRX); // PCシリアルのピン名は USBTX, USBRX
AnalogIn ond(p15); // 温度センサ LM61 10mV/℃ 0℃ 600mV
int main() {
float a,b,c;
while(1) {
a = ond.read(); //0(0V)~1.0(3.3V)の数値
b = a * 3.3; //0V ~ 3.3Vの数値
c = b * 100 - 60; // LM61 0.01V/℃ 0℃ 0.6V (b - 0.6)/0.01
pc.printf("%f V:%f ℃:%f\n", a, b, c);
wait(1.0);
}
}