Fritz Hausmann
/
Bertl_LED04
LED04
Revision 0:8e0d30aad142, committed 2015-04-23
- Comitter:
- fritzhausmann
- Date:
- Thu Apr 23 12:08:25 2015 +0000
- Commit message:
- LED04
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 8e0d30aad142 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Apr 23 12:08:25 2015 +0000 @@ -0,0 +1,18 @@ +#include "mbed.h" + +// LED1 und LED2 abwechselnd mit LED3 und LED4 alle 0.5 Sekunden einschalten + +BusOut myled(LED1, LED2, LED3, LED4); // 4 Leitungen LED1 bis 4 zu einem Anschluß (Port) verbinden.. Bis zu 16 Pins pro Port möglich + +int main() { + bool wechseln = true; // Zustand verwalten + while(1) { + if (wechseln) + myled = 0x3; // Bit 0 und 1 setzen (0x... Haxadezimal) + else + myled = 0x0c; // Bit 2 und 3 setzen (4 + 8 = 12d = 0ch) + + wechseln = !wechseln; // Zustand wechseln + wait(0.5); + } +} \ No newline at end of file
diff -r 000000000000 -r 8e0d30aad142 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Apr 23 12:08:25 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/7e07b6fb45cf \ No newline at end of file