James Jaramillo Huaman
/
mbed-os
mbed-os-Base
main.cpp@0:5c730320c39f, 2021-09-25 (annotated)
- Committer:
- jamesjh98
- Date:
- Sat Sep 25 09:42:41 2021 +0000
- Revision:
- 0:5c730320c39f
sa
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jamesjh98 | 0:5c730320c39f | 1 | /* mbed Microcontroller Library |
jamesjh98 | 0:5c730320c39f | 2 | * Copyright (c) 2019 ARM Limited |
jamesjh98 | 0:5c730320c39f | 3 | * SPDX-License-Identifier: Apache-2.0 |
jamesjh98 | 0:5c730320c39f | 4 | */ |
jamesjh98 | 0:5c730320c39f | 5 | |
jamesjh98 | 0:5c730320c39f | 6 | #include "mbed.h" |
jamesjh98 | 0:5c730320c39f | 7 | #include "platform/mbed_thread.h" |
jamesjh98 | 0:5c730320c39f | 8 | |
jamesjh98 | 0:5c730320c39f | 9 | |
jamesjh98 | 0:5c730320c39f | 10 | // Blinking rate in milliseconds |
jamesjh98 | 0:5c730320c39f | 11 | #define BLINKING_RATE_MS 500 |
jamesjh98 | 0:5c730320c39f | 12 | |
jamesjh98 | 0:5c730320c39f | 13 | |
jamesjh98 | 0:5c730320c39f | 14 | int main() |
jamesjh98 | 0:5c730320c39f | 15 | { |
jamesjh98 | 0:5c730320c39f | 16 | // Initialise the digital pin LED1 as an output |
jamesjh98 | 0:5c730320c39f | 17 | DigitalOut led(LED1); |
jamesjh98 | 0:5c730320c39f | 18 | |
jamesjh98 | 0:5c730320c39f | 19 | while (true) { |
jamesjh98 | 0:5c730320c39f | 20 | led = !led; |
jamesjh98 | 0:5c730320c39f | 21 | thread_sleep_for(BLINKING_RATE_MS); |
jamesjh98 | 0:5c730320c39f | 22 | } |
jamesjh98 | 0:5c730320c39f | 23 | } |