アナログ入力のテスト(温度センサ)

Dependencies:   TextLCD mbed

Revision:
0:e5e36e0aa748
diff -r 000000000000 -r e5e36e0aa748 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Dec 26 08:18:16 2011 +0000
@@ -0,0 +1,15 @@
+#include "mbed.h"
+#include "TextLCD.h"
+
+TextLCD lcd(p24, p26, p27, p28, p29, p30); // rs, e, d4-d7
+AnalogIn temp(p20);
+
+int main() {
+    lcd.cls();
+    lcd.printf("Temperature \n");
+    while (1) {
+        lcd.locate(0,1);
+        lcd.printf("%4.2f Deg",temp.read()*330.0);
+        wait(0.1f);
+    }
+}