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:ffa3929949f3
diff -r 000000000000 -r ffa3929949f3 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sat May 21 07:30:27 2011 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+DigitalOut led3(LED3);
+DigitalOut led4(LED4);
+Serial pc(USBTX, USBRX);
+
+int main() {
+ char ch;
+
+ while(1) {
+
+ pc.printf("Push 1-4 Key->");
+ ch = pc.getc();
+ pc.printf("%c¥r¥n",ch);
+
+ switch(ch)
+ {
+ case '1':
+ led1 =! led1;
+ break;
+ case '2':
+ led2 =! led2;
+ break;
+ case '3':
+ led3 =! led3;
+ break;
+ case '4':
+ led4 =! led4;
+ break;
+ default:
+ pc.printf("Please push the key to 1-4.¥r¥n");
+ break;
+ }
+ }
+}