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:3f87407d8640, 2021-05-24 (annotated)
- Committer:
- fmanzano_dtk
- Date:
- Mon May 24 04:20:16 2021 +0000
- Revision:
- 0:3f87407d8640
- Child:
- 1:c7bcbf5eac28
Version inicial
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fmanzano_dtk | 0:3f87407d8640 | 1 | |
fmanzano_dtk | 0:3f87407d8640 | 2 | #include "mbed.h" |
fmanzano_dtk | 0:3f87407d8640 | 3 | #include "platform/mbed_thread.h" |
fmanzano_dtk | 0:3f87407d8640 | 4 | |
fmanzano_dtk | 0:3f87407d8640 | 5 | |
fmanzano_dtk | 0:3f87407d8640 | 6 | // Blinking rate in milliseconds |
fmanzano_dtk | 0:3f87407d8640 | 7 | #define BLINKING_RATE_MS 500 |
fmanzano_dtk | 0:3f87407d8640 | 8 | |
fmanzano_dtk | 0:3f87407d8640 | 9 | |
fmanzano_dtk | 0:3f87407d8640 | 10 | int main() |
fmanzano_dtk | 0:3f87407d8640 | 11 | { |
fmanzano_dtk | 0:3f87407d8640 | 12 | // Initialise the digital pin LED1 as an output |
fmanzano_dtk | 0:3f87407d8640 | 13 | DigitalOut led(LED1); |
fmanzano_dtk | 0:3f87407d8640 | 14 | |
fmanzano_dtk | 0:3f87407d8640 | 15 | while (true) { |
fmanzano_dtk | 0:3f87407d8640 | 16 | led = !led; |
fmanzano_dtk | 0:3f87407d8640 | 17 | thread_sleep_for(BLINKING_RATE_MS); |
fmanzano_dtk | 0:3f87407d8640 | 18 | } |
fmanzano_dtk | 0:3f87407d8640 | 19 | } |