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:71c6b212eed9
diff -r 000000000000 -r 71c6b212eed9 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Nov 15 18:09:23 2018 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+
+DigitalIn diUp(p15);
+DigitalIn diDown(p12);
+
+BusOut doLeds(LED1,LED2,LED3,LED4);
+
+int main()
+{
+ doLeds = 0;
+ while(1) {
+ if (diDown) {
+ if (doLeds <= 0)
+ doLeds = 8;
+ else
+ doLeds = doLeds>>1; // um eine position nach rechts schieben
+ }
+ else if (diUp){
+ if (doLeds <= 0)
+ doLeds = 1;
+ else
+ doLeds = doLeds<<1; // um eine position nach links schieben
+ }
+ if (doLeds != 0)
+ wait(0.5);
+ }
+}
+
+