Mbed OS Blinky tutorial
Get the Mbed OS Blinky example built and running on your board. Blinky is a simple application that blinks the LED on your development board every 500 milliseconds.
Setting up
- Create an Mbed account.
- Install Mbed Studio:
Creating a Blinky program
-
From the menu, select File > New Program....
The New program dialog box opens.
-
From the Example program drop-down list, select in the MBED OS 6 list:
- For the Mbed OS full profile:
mbed-os-example-blinky
- For the Mbed OS bare metal profile:
mbed-os-example-blinky-baremetal
- For the Mbed OS full profile:
-
The Program name field is automatically populated. You can edit it if you want.
Mbed Studio sets the newly created program as the active program by default. For this quick-start, please leave the option selected.
-
For the Mbed OS location, select Store Mbed OS in the program folder (+1GB). This will download a new copy of Mbed OS and store it in your program folder.
-
Click Add Program.
The program is loaded to your workspace and is the active program.
Selecting a build target and profile
-
A build target tells Mbed Studio how to build Mbed OS so that it matches your hardware. To select a target, you can:
- Connect your board to your computer. Mbed Studio detects the board and suggests a matching target.
- Use the Target drop-down list. Your target name most likely matches the board name.
Tip: If you don't have a board, pick any target you want.
-
The default build profile is Debug, and we recommend you use it for this quick start.
Building and flashing to the board
To build:
-
If you don't have a board, click Build (the hammer icon). This builds Blinky and stops.
-
If you have a board connected, click Build and run (the play icon). This builds Blinky and flashes it to the connected board.
You may need to restart your board for Blinky to run.