T Umezawa
/
light6
Checking temperature
Diff: main.cpp
- Revision:
- 0:b6605fb3b120
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Dec 29 05:31:51 2020 +0000 @@ -0,0 +1,16 @@ +#include "mbed.h" +Serial pc(USBTX, USBRX); +AnalogIn tem(A6); +DigitalOut conv(A3); + +int main() +{ + double temper; + conv = 1; + wait(0.5); + for(int i = 0; i<10; i++) { + temper = (tem.read()*3.3-0.6)*100; + pc.printf("Tem=%f\r\n",temper); + wait(0.5); + } +} \ No newline at end of file