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:5a125b0e938e
diff -r 000000000000 -r 5a125b0e938e main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sun Aug 29 01:42:53 2010 +0000
@@ -0,0 +1,30 @@
+#include "mbed.h"
+#include "TextLCD.h"
+
+#define ON 1
+#define OFF 0
+
+DigitalOut mled1(LED1);
+DigitalOut mled2(LED2);
+DigitalOut mled3(LED3);
+DigitalOut mled4(LED4);
+AnalogIn adc_in(p20);
+
+TextLCD lcd(p24, p25, p26, p27, p28, p29, p30,16,2); // rs, rw, e, d0, d1, d2, d3
+
+void main() {
+ while(1){
+ lcd.cls();
+ lcd.locate(0,0);
+ lcd.printf("Vin:%2.1fV",adc_in.read()*15);
+ lcd.locate(0,1);
+ lcd.printf("Mode:Vin now!");
+ mled1=ON;
+ mled1=ON;
+ wait(0.3);
+ lcd.locate(0,1);
+ lcd.printf("Mode: ");
+ mled1=OFF;
+ wait(0.3);
+ }
+}
\ No newline at end of file