Yasushi TAUCHI / Mbed 2 deprecated giken9_TextLCD_temperature

Dependencies:   TextLCD mbed-rtos mbed

Fork of TextLCD_HelloWorld by Simon Ford

Files at this revision

API Documentation at this revision

Comitter:
yueee_yt
Date:
Wed Mar 12 01:04:11 2014 +0000
Parent:
2:ad0b044d0a10
Commit message:
Initial Version

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sat Dec 04 11:31:07 2010 +0000
+++ b/main.cpp	Wed Mar 12 01:04:11 2014 +0000
@@ -1,10 +1,37 @@
-// Hello World! for the TextLCD
-
 #include "mbed.h"
 #include "TextLCD.h"
+#include "rtos.h"
 
-TextLCD lcd(p15, p16, p17, p18, p19, p20); // rs, e, d4-d7
+TextLCD lcd(p24, p26, p27, p28, p29, p30); // rs, e, d4-d7
+AnalogIn ain(p20);
+DigitalOut led(LED1);
+
+float Temp;
 
-int main() {
-    lcd.printf("Hello World!\n");
+void display(void const *n)
+{
+    static int num=0;
+    lcd.locate(0,0);
+    lcd.printf("Count %3d",num);
+    lcd.locate(0,1);
+    lcd.printf("Temp=%4.1f",Temp);
+    num++;
+    if(num>999)num=0;
 }
+
+void measure(void const *n)
+{
+    Temp=ain.read()*3.3*100;
+    led=!led;
+}
+
+int main()
+{
+    led=0;
+    lcd.cls();
+    RtosTimer measure_timer(measure);
+    RtosTimer display_timer(display);
+    measure_timer.start(2000);
+    display_timer.start(3000);
+    Thread::wait(osWaitForever);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Wed Mar 12 01:04:11 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed-rtos/#771275db0efe
--- a/mbed.bld	Sat Dec 04 11:31:07 2010 +0000
+++ b/mbed.bld	Wed Mar 12 01:04:11 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e
+http://mbed.org/users/mbed_official/code/mbed/builds/8e73be2a2ac1
\ No newline at end of file