温度センサLM75Bとキャラクタ液晶AQM0802Aをmbed LPC1114FN28に繋げて、温度をキャラク液晶に出力するプログラム
Dependencies: LM75B SB1602E mbed
Revision 0:34ef48e4a588, committed 2016-05-15
- Comitter:
- jksoft
- Date:
- Sun May 15 11:38:21 2016 +0000
- Commit message:
- ??
Changed in this revision
diff -r 000000000000 -r 34ef48e4a588 LM75B.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LM75B.lib Sun May 15 11:38:21 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/neilt6/code/LM75B/#7ac462ba84ac
diff -r 000000000000 -r 34ef48e4a588 SB1602E.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SB1602E.lib Sun May 15 11:38:21 2016 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/okano/code/SB1602E/#baf578069dfc
diff -r 000000000000 -r 34ef48e4a588 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun May 15 11:38:21 2016 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" +#include "LM75B.h" +#include "SB1602E.h" + +//Create an LM75B object at the default address (ADDRESS_0) +LM75B sensor(dp5, dp27); +SB1602E lcd( dp5, dp27); + +int main() +{ + //Try to open the LM75B + if (sensor.open()) { + printf("Device detected!\n"); + + while (1) { + lcd.clear(); + //Print the current temperature + lcd.printf(0,"Tmp:%.1f\n", (float)sensor); + + //Sleep for 0.5 seconds + wait(0.5); + } + } else { + error("Device not detected!\n"); + } +}
diff -r 000000000000 -r 34ef48e4a588 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun May 15 11:38:21 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/082adc85693f \ No newline at end of file