Steffen Rauleder
/
mbed-os-example-mbed5-blinky
lfb interrupt
01Tasteninterrupt.cpp@0:f16b5c6f43ab, 2021-12-15 (annotated)
- Committer:
- rauleder
- Date:
- Wed Dec 15 10:15:08 2021 +0000
- Revision:
- 0:f16b5c6f43ab
erster MBED Beispiel
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rauleder | 0:f16b5c6f43ab | 1 | #if 0 |
rauleder | 0:f16b5c6f43ab | 2 | /* mbed Microcontroller Library |
rauleder | 0:f16b5c6f43ab | 3 | * Copyright (c) 2019 ARM Limited |
rauleder | 0:f16b5c6f43ab | 4 | * SPDX-License-Identifier: Apache-2.0 |
rauleder | 0:f16b5c6f43ab | 5 | */ |
rauleder | 0:f16b5c6f43ab | 6 | |
rauleder | 0:f16b5c6f43ab | 7 | #include "mbed.h" |
rauleder | 0:f16b5c6f43ab | 8 | #include "platform/mbed_thread.h" |
rauleder | 0:f16b5c6f43ab | 9 | #include "LCD.h" |
rauleder | 0:f16b5c6f43ab | 10 | |
rauleder | 0:f16b5c6f43ab | 11 | // Blinking rate in milliseconds |
rauleder | 0:f16b5c6f43ab | 12 | #define BLINKING_RATE_MS 1000 |
rauleder | 0:f16b5c6f43ab | 13 | |
rauleder | 0:f16b5c6f43ab | 14 | DigitalOut statusled(PC_0); |
rauleder | 0:f16b5c6f43ab | 15 | lcd meinLCD; |
rauleder | 0:f16b5c6f43ab | 16 | |
rauleder | 0:f16b5c6f43ab | 17 | |
rauleder | 0:f16b5c6f43ab | 18 | int main() |
rauleder | 0:f16b5c6f43ab | 19 | { |
rauleder | 0:f16b5c6f43ab | 20 | // Initialise the digital pin LED1 as an output |
rauleder | 0:f16b5c6f43ab | 21 | int zaehler=0; |
rauleder | 0:f16b5c6f43ab | 22 | DigitalOut led(LED1); |
rauleder | 0:f16b5c6f43ab | 23 | meinLCD.clear(); |
rauleder | 0:f16b5c6f43ab | 24 | meinLCD.cursorpos(0x40); |
rauleder | 0:f16b5c6f43ab | 25 | meinLCD.printf("Hallo Welt"); |
rauleder | 0:f16b5c6f43ab | 26 | |
rauleder | 0:f16b5c6f43ab | 27 | while (true) { |
rauleder | 0:f16b5c6f43ab | 28 | led = !led; |
rauleder | 0:f16b5c6f43ab | 29 | zaehler++; |
rauleder | 0:f16b5c6f43ab | 30 | meinLCD.cursorpos(0x00); |
rauleder | 0:f16b5c6f43ab | 31 | meinLCD.printf("Zaehler = %d ",zaehler); |
rauleder | 0:f16b5c6f43ab | 32 | thread_sleep_for(BLINKING_RATE_MS); |
rauleder | 0:f16b5c6f43ab | 33 | } |
rauleder | 0:f16b5c6f43ab | 34 | } |
rauleder | 0:f16b5c6f43ab | 35 | #endif |