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.
Diff: main.cpp
- Revision:
- 0:23e6b8ed8dbd
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sun Dec 25 17:33:53 2011 +0000
@@ -0,0 +1,38 @@
+#include "mbed.h"
+#include "lcd_2wire.h"
+
+
+lcd_2wire dis(p29,p30);
+AnalogIn input(p20);
+DigitalOut myled(LED1);
+
+float wert;
+char c[3];
+int main() {
+ dis.lcd_init();
+ dis.lcd_goto_xy(0,0);
+ dis.lcd_write_str("********************");
+ dis.lcd_goto_xy(7,1);
+ dis.lcd_write_str("Hallo");
+ dis.lcd_goto_xy(7,2);
+ dis.lcd_write_str("MBED!");
+ dis.lcd_goto_xy(0,3);
+ dis.lcd_write_str("********************");
+ wait(2);
+
+
+ while (1) {
+ wert = input.read();
+ sprintf(c,"%.3f",wert);
+ dis.lcd_clear();
+ dis.lcd_goto_xy(7,1);
+ dis.lcd_write_str("Analogwert:");
+ dis.lcd_goto_xy(7,2);
+ dis.lcd_write_str(c);
+ wait_ms(1);
+ myled = 1;
+ wait(0.1);
+ myled = 0;
+ wait(0.1);
+ }
+}