![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
温度テスト
Diff: main.cpp
- Revision:
- 0:7cd04e63ec48
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Sep 12 09:54:58 2016 +0000 @@ -0,0 +1,30 @@ +#include "mbed.h" +#include "SB1602E.h" + + +AnalogIn sensor(A3); +Serial pc(USBTX,USBRX); +I2C i2c( p22, p20 ); +SB1602E lcd( i2c ); // SDA, SCL + + +//SB1602E lcd( p28, p27 ); // SDA, SCL + + + +int main() { + + while(1) { + float Temperature; + + Temperature = (sensor*3.3-0.6)/0.01; + + pc.printf("Temperature=%\r\n",Temperature); + + + lcd.printf(0.0,"%.2f",Temperature); + + wait(1.0); + } +} + \ No newline at end of file