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:b04485efd862, committed 2015-03-06
- Comitter:
- Enenkel
- Date:
- Fri Mar 06 08:01:28 2015 +0000
- Commit message:
- Lauflicht ?ber12 LED mit 1 LED BITSCHIEBEN
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 |
diff -r 000000000000 -r b04485efd862 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Mar 06 08:01:28 2015 +0000
@@ -0,0 +1,40 @@
+#include "mbed.h"
+// Lektion02g: Lauflicht über 12 LED mit 1 LED via BITSCHIEBEN
+// BULME Graz, 2015-02-09, by Enekel
+// AUFGABE: 1) Kopiere diese Software in ein neues Programm
+// und gib diesem Programm deinen Namen !
+// 2) Lade die Software auf dein Board und pronbiere sie aus
+// 3) Ändere die software wie folgt ab:
+// a) Die LED beginnen bei D1 statt bei D20 (MSB - LSB vertauschen!)
+// Ausprobieren ob es geht!
+// b) Lass statt einer LED immer 2 LED laufen!
+// Ausprobieren ob es geht !
+// c) Lasse das Muster 11011 über die 12 LED's laufen
+// 0000 0001 1011 -> 001B !
+// d) Alle LED leuchten, nur eines ist aus und huscht über die Leiste
+// Invers !
+
+// DEFINITIONEN *************************************************
+BusOut led(P1_13,P1_12,P1_7,P1_6,P1_4,P1_3,P1_1,P1_0,LED4,LED3,LED2,LED1);
+// LSB MSB
+int i; // definition eines Integer (einer ganzen Zahl) mit dem Namen i
+
+// HAUPTPROGRAMM ***********************************************
+int main() {
+ led=0xFFFF;
+ wait(1);
+ while(1)
+ {
+ i=0;
+ led=0x0001; //LED 0000 0000 0001
+ for (i=0;i<12;i=i++) // Schleife von i=0; solange i kleiner als 12;
+ // erhöhe i bei jedem Durchgang um 1
+ {
+ wait(0.2);
+ led=led<<2; // verschiebe das BIT um eins Richtung MSB
+ }
+
+ }
+}
+// ENDE *****************************************************
+
diff -r 000000000000 -r b04485efd862 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Mar 06 08:01:28 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5 \ No newline at end of file