
Fork
main.cpp@7:33c7de8ea2da, 2021-05-28 (annotated)
- Committer:
- NTHU666
- Date:
- Fri May 28 10:21:44 2021 +0000
- Revision:
- 7:33c7de8ea2da
- Parent:
- 6:624c1eb306dc
- Child:
- 8:bfe8885c170d
1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
NTHU666 | 0:957b5f4f5480 | 1 | /* mbed Microcontroller Library |
NTHU666 | 0:957b5f4f5480 | 2 | * Copyright (c) 2019 ARM Limited |
NTHU666 | 0:957b5f4f5480 | 3 | * SPDX-License-Identifier: Apache-2.0 |
NTHU666 | 0:957b5f4f5480 | 4 | */ |
NTHU666 | 0:957b5f4f5480 | 5 | |
NTHU666 | 0:957b5f4f5480 | 6 | #include "mbed.h" |
NTHU666 | 0:957b5f4f5480 | 7 | #include "platform/mbed_thread.h" |
NTHU666 | 0:957b5f4f5480 | 8 | |
NTHU666 | 7:33c7de8ea2da | 9 | //111 |
NTHU666 | 0:957b5f4f5480 | 10 | // Blinking rate in milliseconds |
NTHU666 | 0:957b5f4f5480 | 11 | #define BLINKING_RATE_MS 500 |
NTHU666 | 0:957b5f4f5480 | 12 | |
NTHU666 | 0:957b5f4f5480 | 13 | |
NTHU666 | 0:957b5f4f5480 | 14 | int main() |
NTHU666 | 0:957b5f4f5480 | 15 | { |
NTHU666 | 0:957b5f4f5480 | 16 | // Initialise the digital pin LED1 as an output |
NTHU666 | 1:9f5b7cc77ef0 | 17 | DigitalOut led(PB_3); |
NTHU666 | 0:957b5f4f5480 | 18 | |
NTHU666 | 0:957b5f4f5480 | 19 | while (true) { |
NTHU666 | 0:957b5f4f5480 | 20 | led = !led; |
NTHU666 | 0:957b5f4f5480 | 21 | thread_sleep_for(BLINKING_RATE_MS); |
NTHU666 | 0:957b5f4f5480 | 22 | } |
NTHU666 | 0:957b5f4f5480 | 23 | } |