Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: TextLCD mbed-rtos mbed
Fork of TextLCD_HelloWorld by
Revision 3:4fb8133db562, committed 2014-03-12
- Comitter:
- yueee_yt
- Date:
- Wed Mar 12 01:04:11 2014 +0000
- Parent:
- 2:ad0b044d0a10
- Commit message:
- Initial Version
Changed in this revision
--- 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
