Lauflicht led 1-4
Dependencies: mbed
Revision 1:201c99e74ae0, committed 2015-03-05
- Comitter:
- SebiStr99
- Date:
- Thu Mar 05 13:49:54 2015 +0000
- Parent:
- 0:11c4ec07937f
- Commit message:
- LED lauflicht hexadecimal
Changed in this revision
Lauflicht.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Lauflicht.cpp Thu Mar 05 13:03:00 2015 +0000 +++ b/Lauflicht.cpp Thu Mar 05 13:49:54 2015 +0000 @@ -1,30 +1,25 @@ #include "mbed.h" -DigitalOut led1(LED1); -DigitalOut led2(LED2); -DigitalOut led3(LED3); -DigitalOut led4(LED4); +BusOut led(LED1, LED2, LED3, LED4); int main () { + bool change = 1; + while (1) { + if(change) + { + led = 0x03; + } + else + { + led = 0x0c; + } - led3 = 0; - wait (0.25); - led4 = 0; - wait (0.25); - led1 = 1; - wait (0.25); - led2 = 1; - wait (0.25); - led1 = 0; - led3 = 1; - wait (0.25); - led2 = 0; - led4 = 1; - wait (0.25); - + change = !change; + waitms(500); + }