Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp@0:99c19dff3a25, 2020-10-06 (annotated)
- Committer:
- _lukas_formanek
- Date:
- Tue Oct 06 07:21:25 2020 +0000
- Revision:
- 0:99c19dff3a25
- Child:
- 1:1579d36c7659
ver 1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
_lukas_formanek | 0:99c19dff3a25 | 1 | /* mbed Microcontroller Library |
_lukas_formanek | 0:99c19dff3a25 | 2 | * Copyright (c) 2019 ARM Limited |
_lukas_formanek | 0:99c19dff3a25 | 3 | * SPDX-License-Identifier: Apache-2.0 |
_lukas_formanek | 0:99c19dff3a25 | 4 | */ |
_lukas_formanek | 0:99c19dff3a25 | 5 | |
_lukas_formanek | 0:99c19dff3a25 | 6 | #include "mbed.h" |
_lukas_formanek | 0:99c19dff3a25 | 7 | #include "platform/mbed_thread.h" |
_lukas_formanek | 0:99c19dff3a25 | 8 | |
_lukas_formanek | 0:99c19dff3a25 | 9 | |
_lukas_formanek | 0:99c19dff3a25 | 10 | // Blinking rate in milliseconds |
_lukas_formanek | 0:99c19dff3a25 | 11 | #define BLINKING_RATE_MS 500 |
_lukas_formanek | 0:99c19dff3a25 | 12 | |
_lukas_formanek | 0:99c19dff3a25 | 13 | |
_lukas_formanek | 0:99c19dff3a25 | 14 | int main() |
_lukas_formanek | 0:99c19dff3a25 | 15 | { |
_lukas_formanek | 0:99c19dff3a25 | 16 | // Initialise the digital pin LED1 as an output |
_lukas_formanek | 0:99c19dff3a25 | 17 | DigitalOut led(LED1); |
_lukas_formanek | 0:99c19dff3a25 | 18 | |
_lukas_formanek | 0:99c19dff3a25 | 19 | while (true) { |
_lukas_formanek | 0:99c19dff3a25 | 20 | led = !led; |
_lukas_formanek | 0:99c19dff3a25 | 21 | thread_sleep_for(BLINKING_RATE_MS); |
_lukas_formanek | 0:99c19dff3a25 | 22 | } |
_lukas_formanek | 0:99c19dff3a25 | 23 | } |