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
Fork of _Lektion_01 by
Revision 3:c9bfffe4f141, committed 2016-01-08
- Comitter:
- Matthias_Praja
- Date:
- Fri Jan 08 15:54:44 2016 +0000
- Parent:
- 2:619cddfe256e
- Commit message:
- Knight Raider Light
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Mar 11 08:15:44 2015 +0000
+++ b/main.cpp Fri Jan 08 15:54:44 2016 +0000
@@ -1,29 +1,70 @@
-// HIMBED Lektion_01 mit D1 blinken
-// by Gottfried ENENKEL 2014-12-12
-// AUFGABE:
-// 1. Importiere dieses Programm in deinen Programmordner
-// 2. Lade es auf dein HIMBED
-// 3. Bringe das Programm auf deinem HIMBED zum Laufen
-// 4. Verändere das Programm so,
-// das die LED D1 im SEKUNDENTAKT blinkt ! ->
-// Compilieren, Laden, Testen (CLT)
-//
-// INCLUDE ************************
-#include "mbed.h" // Includiere den Befehlsatz welcher in mbed.h
- // gespeichert ist.
+
+#include "mbed.h"
+
// Konstante **********************
-DigitalOut LedD1(P1_8); // Nimm den Schaltplan und kontrolliere:
- // Die LED D1 führt über LED1 zum Port 0 Pin1 des uP
- // DigitalOut -> Definiere den Ausgang P1_8
- // (Port1 Pin8) zum Ausgang
- // Nenne das Signal LedD1 (Weil es zur D1 führt.
+DigitalOut LedD10 (P1_8); // LED D10 bis D13 IO Definieren
+DigitalOut LedD11 (P1_9);
+DigitalOut LedD12 (P1_10);
+DigitalOut LedD13 (P1_11);
// Hauptprogramm ******************
-int main(void) { // Haupt Routine Beginnt mit { endet mit }
- while(1) { // Bleibe dauern in dieser Schleife
- LedD1 = 1; // LED D1 einschalten
- wait(1.5); // 0.5 sec warten
- LedD1 = 0; // LED D1 ausschalten
- wait(1.5); // 0.5 sec warten
+int main(void) {
+ while(1) {
+
+
+ LedD10 = 1; //L-R LED EIN
+ wait(0.1);
+
+ LedD11 = 1;
+ wait(0.1);
+
+ LedD12 = 1;
+ wait(0.1);
+
+ LedD13 = 1;
+ wait(0.1);
+
+
+
+ LedD10 = 0; //L-R LED AUS
+ wait(0.1);
+
+ LedD11 = 0;
+ wait(0.1);
+
+ LedD12 = 0;
+ wait(0.1);
+
+ LedD13 = 0;
+ wait(0.1);
+
+ wait(0.1); //Warten
+
+ LedD13 = 1; //R-L LED EIN
+ wait(0.1);
+
+ LedD12 = 1;
+ wait(0.1);
+
+ LedD11 = 1;
+ wait(0.1);
+
+ LedD10 = 1;
+ wait(0.1);
+
+
+ LedD13 = 0; //R-L LED AUS
+ wait(0.1);
+
+ LedD12 = 0;
+ wait(0.1);
+
+ LedD11 = 0;
+ wait(0.1);
+
+ LedD10 = 0;
+ wait(0.1);
+
+ wait(0.1); //Warten
}
}
// ENDE ***************************
