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: mbed
Revision 0:e442786011b8, committed 2018-04-25
- Comitter:
- sjpabury
- Date:
- Wed Apr 25 11:48:29 2018 +0000
- Commit message:
- LED Laufband;
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Apr 25 11:48:29 2018 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"
+
+BusOut myleds(LED1,LED2,LED3,LED4); //LEDs werden als "Bus" zusammengefasst
+
+int main()
+{
+ while(1)
+ {
+ for(int i = 1;i<9;i=i*2) //for-schleife mit zählerindex i und der Abbruchbedingung falls i >= 9 wird
+ //(i nimmt die Werte 1,2,4 und 8 an)
+ {
+
+ myleds = i; //der ganze Bus wird gleich i gesetzt (wenn i dezimal ist, wird dieser wert beim kompelieren
+ wait(0.2); //in das binäre Zahlensystem umgewandelt, zB: i = 10 -> 1010 => Led4 und Led2 leuchten)
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Apr 25 11:48:29 2018 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/mbed_official/code/mbed/builds/97feb9bacc10 \ No newline at end of file