This is a very simple guide, reviewing the steps required to get Blinky working on an Mbed OS platform.

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers <title>main.cpp Source File</title>

main.cpp

00001 /* mbed Microcontroller Library
00002  * Copyright (c) 2019 ARM Limited
00003  * SPDX-License-Identifier: Apache-2.0
00004  */
00005 
00006 #include "mbed.h"
00007 #include "platform/mbed_thread.h"
00008 
00009 
00010 // Blinking rate in milliseconds
00011 #define BLINKING_RATE_MS                                                    500
00012 
00013 
00014 int main()
00015 {
00016     // Initialise the digital pin LED1 as an output
00017     DigitalOut led(LED1);
00018 
00019     while (true) {
00020         led = !led;
00021         thread_sleep_for(BLINKING_RATE_MS);
00022     }
00023 }