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.
Dependencies: MCP342x ssd1306_library
main.cpp@0:fcf0df749468, 2019-12-16 (annotated)
- Committer:
- makermax
- Date:
- Mon Dec 16 14:12:17 2019 +0000
- Revision:
- 0:fcf0df749468
- Child:
- 1:c410db7a0673
hello world
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| makermax | 0:fcf0df749468 | 1 | /* mbed Microcontroller Library |
| makermax | 0:fcf0df749468 | 2 | * Copyright (c) 2019 ARM Limited |
| makermax | 0:fcf0df749468 | 3 | * SPDX-License-Identifier: Apache-2.0 |
| makermax | 0:fcf0df749468 | 4 | */ |
| makermax | 0:fcf0df749468 | 5 | |
| makermax | 0:fcf0df749468 | 6 | #include "mbed.h" |
| makermax | 0:fcf0df749468 | 7 | #include "platform/mbed_thread.h" |
| makermax | 0:fcf0df749468 | 8 | |
| makermax | 0:fcf0df749468 | 9 | |
| makermax | 0:fcf0df749468 | 10 | // Blinking rate in milliseconds |
| makermax | 0:fcf0df749468 | 11 | #define BLINKING_RATE_MS 500 |
| makermax | 0:fcf0df749468 | 12 | |
| makermax | 0:fcf0df749468 | 13 | |
| makermax | 0:fcf0df749468 | 14 | int main() |
| makermax | 0:fcf0df749468 | 15 | { |
| makermax | 0:fcf0df749468 | 16 | // Initialise the digital pin LED1 as an output |
| makermax | 0:fcf0df749468 | 17 | DigitalOut led(LED1); |
| makermax | 0:fcf0df749468 | 18 | |
| makermax | 0:fcf0df749468 | 19 | while (true) { |
| makermax | 0:fcf0df749468 | 20 | led = !led; |
| makermax | 0:fcf0df749468 | 21 | thread_sleep_for(BLINKING_RATE_MS); |
| makermax | 0:fcf0df749468 | 22 | } |
| makermax | 0:fcf0df749468 | 23 | } |