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:62f49adb8b8f, 2022-11-29 (annotated)
- Committer:
- 98127869-a5d9-49e4-b5d6-06fd9acda6d9
- Date:
- Tue Nov 29 14:59:08 2022 +0000
- Revision:
- 0:62f49adb8b8f
fun
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 1 | /* mbed Microcontroller Library | 
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 2 | * Copyright (c) 2019 ARM Limited | 
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 3 | * SPDX-License-Identifier: Apache-2.0 | 
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 4 | */ | 
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 5 | |
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 6 | #include "mbed.h" | 
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 7 | #include "platform/mbed_thread.h" | 
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 8 | |
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 9 | |
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 10 | // Blinking rate in milliseconds | 
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 11 | #define BLINKING_RATE_MS 500 | 
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 12 | |
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 13 | |
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 14 | int main() | 
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 15 | { | 
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 16 | // Initialise the digital pin LED1 as an output | 
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 17 | DigitalOut led(LED1); | 
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 18 | |
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 19 | while (true) { | 
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 20 | led = !led; | 
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 21 | thread_sleep_for(BLINKING_RATE_MS); | 
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 22 | } | 
| 98127869-a5d9-49e4-b5d6-06fd9acda6d9 | 0:62f49adb8b8f | 23 | } |