![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
TINF_TwoLEDsX
main.cpp@1:cc9fba0cbda0, 2018-11-15 (annotated)
- Committer:
- martwerl
- Date:
- Thu Nov 15 18:18:18 2018 +0000
- Revision:
- 1:cc9fba0cbda0
- Parent:
- 0:6222193a31e0
TINF_mbedSimulator_2Leds
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
martwerl | 0:6222193a31e0 | 1 | #include "mbed.h" |
martwerl | 1:cc9fba0cbda0 | 2 | #include "2Leds.h" |
martwerl | 1:cc9fba0cbda0 | 3 | |
martwerl | 0:6222193a31e0 | 4 | |
martwerl | 0:6222193a31e0 | 5 | DigitalOut led(LED1); |
martwerl | 0:6222193a31e0 | 6 | |
martwerl | 0:6222193a31e0 | 7 | TwoLeds twoleds(LED1, LED2); |
martwerl | 0:6222193a31e0 | 8 | |
martwerl | 0:6222193a31e0 | 9 | int main() |
martwerl | 0:6222193a31e0 | 10 | { |
martwerl | 0:6222193a31e0 | 11 | while (1) |
martwerl | 0:6222193a31e0 | 12 | { |
martwerl | 1:cc9fba0cbda0 | 13 | twoleds.ledOn(); //LEDs ein/aus |
martwerl | 0:6222193a31e0 | 14 | twoleds.printStatus(); |
martwerl | 0:6222193a31e0 | 15 | wait_ms(500); |
martwerl | 0:6222193a31e0 | 16 | twoleds.ledOff(); |
martwerl | 0:6222193a31e0 | 17 | twoleds.printStatus(); |
martwerl | 1:cc9fba0cbda0 | 18 | wait_ms(500); |
martwerl | 1:cc9fba0cbda0 | 19 | |
martwerl | 1:cc9fba0cbda0 | 20 | for(int i = 0; i <= 3; i++) |
martwerl | 1:cc9fba0cbda0 | 21 | { |
martwerl | 1:cc9fba0cbda0 | 22 | twoleds.ledX(); |
martwerl | 1:cc9fba0cbda0 | 23 | twoleds.printStatus(); |
martwerl | 1:cc9fba0cbda0 | 24 | wait_ms(500); |
martwerl | 1:cc9fba0cbda0 | 25 | } |
martwerl | 0:6222193a31e0 | 26 | } |
martwerl | 0:6222193a31e0 | 27 | } |