Lauflicht mit HEXA - Zahlen
Dependencies: mbed
Revision 0:ae5b417143b2, committed 2017-05-02
- Comitter:
- Leonard_Haghofer
- Date:
- Tue May 02 09:20:35 2017 +0000
- Commit message:
- Lauflicht Vor und Zur?ck.
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 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
diff -r 000000000000 -r ae5b417143b2 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue May 02 09:20:35 2017 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/mbed_official/code/mbed/builds/794e51388b66 \ No newline at end of file