Lehrer Busch
/
030_LED_blink_thread_AA
030_LED_blink_thread_AA
main.cpp@1:a1a13b950ded, 2022-02-04 (annotated)
- Committer:
- itbusch
- Date:
- Fri Feb 04 07:18:38 2022 +0000
- Revision:
- 1:a1a13b950ded
- Parent:
- 0:383080487f30
030_LED_blink_thread
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
itbusch | 0:383080487f30 | 1 | /* mbed BuschA |
itbusch | 0:383080487f30 | 2 | */ |
itbusch | 0:383080487f30 | 3 | |
itbusch | 0:383080487f30 | 4 | #include "mbed.h" |
itbusch | 0:383080487f30 | 5 | // Blinking rate in milliseconds //defines |
itbusch | 1:a1a13b950ded | 6 | #define BLINKING_RATE_MS 1000 //Wartezeit festlegen |
itbusch | 0:383080487f30 | 7 | |
itbusch | 0:383080487f30 | 8 | //Initialisiere Ausgangspin und Variable |
itbusch | 0:383080487f30 | 9 | DigitalOut Boardled(LED1); |
itbusch | 0:383080487f30 | 10 | DigitalOut Oszi(D3); |
itbusch | 0:383080487f30 | 11 | |
itbusch | 0:383080487f30 | 12 | int main() |
itbusch | 0:383080487f30 | 13 | { |
itbusch | 0:383080487f30 | 14 | |
itbusch | 0:383080487f30 | 15 | while (true) |
itbusch | 0:383080487f30 | 16 | { |
itbusch | 0:383080487f30 | 17 | Boardled = 1; |
itbusch | 0:383080487f30 | 18 | Oszi = 1; |
itbusch | 0:383080487f30 | 19 | thread_sleep_for(BLINKING_RATE_MS); //Sleep = Warten... |
itbusch | 0:383080487f30 | 20 | Boardled = 0; |
itbusch | 0:383080487f30 | 21 | Oszi = 0; |
itbusch | 0:383080487f30 | 22 | thread_sleep_for(BLINKING_RATE_MS); //Sleep = Warten... |
itbusch | 0:383080487f30 | 23 | } |
itbusch | 0:383080487f30 | 24 | } |