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
Diff: main.cpp
- Revision:
- 0:ae5b417143b2
diff -r 000000000000 -r ae5b417143b2 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue May 02 09:20:35 2017 +0000
@@ -0,0 +1,82 @@
+#include "mbed.h"
+// HIMBED Lektion_04 "Lauflicht 8LED via BUS"
+//
+// AUFGABE:
+// Die LED D20 bis D13 werden als BUS definiert.
+// 8 Leitungen -> =2x4 leitungen -> 00 bis FF
+// 2 LED soll hin und her laufen
+// Am Anfang und am Ende darf kein LED leuchten !
+// bei LED 20 beginnen !
+// DEFINITIONEN *************************************************
+// Bus Definition
+// LED D20 geht auf EP113 und weiter auf P0_13
+// BusOut led(*,*,*,*,*); BUS mit LEDs definiern.
+// LSB * Bus ergänzen! * MSB
+
+// HAUPTPROGRAMM ***********************************************
+/*
+int main()
+{
+ led=0xFF; // Alle 8 LED EIN
+ wait(1); // warte 1 sec.
+ while(1) // Hauptschleife
+ {
+ led=0x00; //LED 0000 0000 Hex 00
+ wait(0.2);
+ led=0x01; //LED 0000 0001 Hex 01
+ wait (0.2);
+ led=0x03;
+ wait (0.2);
+ led=0x06;
+ wait (0.2);
+ led=0x0C;
+ wait (0.2);
+ led=0x18;
+ wait (0.2);
+ led=0x30;
+ wait (0.2);
+ led=0x60;
+ wait (0.2);
+ led=0xC0;
+ wait (0.2);
+ led=0x80;
+ wait (0.2);
+ led=0x00;
+ wait (0.2);
+ led=0x80;
+ wait (0.2);
+ led=0xC0;
+ wait (0.2);
+ led=0x60;
+ wait (0.2);
+ led=0x30;
+ wait (0.2);
+ led=0x18;
+ wait (0.2);
+ led=0x0C;
+ wait (0.2);
+ led=0x06;
+ wait (0.2);
+ led=0x03;
+ wait (0.2);
+ led=0x01;
+ wait (0.2);
+ led=0x00;
+ wait (0.2);
+
+ //LED 0000 0011 Hex 03
+ // Ergänze selber in HEX!
+
+
+ led=0xFF; //LED 0000 0110
+ wait (0.2);
+ //LED 0000 1100
+ //LED 0001 1000
+ // usw
+ // dann läuft der Balken wieder zurück!
+
+ }
+}
+// ENDE *****************************************************
+
+*/
\ No newline at end of file