The example program for mbed pin-compatible platforms

Dependencies:   mbed

Mbed 2

This is an Mbed 2 project. If you'd like to learn about using blinky with Mbed OS please see the mbed-os docs.

Intro

This example demonstrates how to blink an led using the DigitalOut API. On all mbed platforms the pins LED1, LED2, LED3, and LED4 have mappings to led's on the board. Sometimes there are 4 different LED's, sometimes they all map to the same LED, sometimes they will map to pins on a tricolor led. This varies depending on who made the board, but the definitions are always valid.

How to use

Import this code into your compiler, select your platform from the top right, compile the code, load it onto your board, press the reset button on the board and you code will run. See the led blink!

Challenge

Challenge 1

Now, try changing which led's blink by changing LED1 to LED2-4. Check the pin mapping on your boards platform page for where the led's are mapped to.

Challenge 2

Try changing the speed the led's blink at by changing the numbers in the wait() function. The wait function is in seconds, so wait(0.5) waits for half a second.

Challenge 3

Try turning on multiple LED's at the same time. If you have a tri-color LED on the board this will make it change colors. If you have multiple LED's on the board you will be able to see multiple turn on. If you only have 1 LED on the board then this will do nothing special.

Revisions of mbed.bld

Revision Date Message Actions
22:a9f5798bf27e 3 months ago Update libraries File  Diff  Annotate
21:5a2e8a75ddff 8 months ago Update libraries File  Diff  Annotate
20:7c9e1ce926ec 14 months ago Update libraries File  Diff  Annotate
19:2157e25073b7 17 months ago Update libraries File  Diff  Annotate
18:1fe1cb83472f 19 months ago Update libraries File  Diff  Annotate
17:2d94d773fa58 22 months ago Update libraries File  Diff  Annotate
16:382668078fab 2017-05-12 Update libraries File  Diff  Annotate
15:165ecc5f4280 2017-01-18 Update libraries File  Diff  Annotate
14:981d248a8057 2016-10-28 Update libraries File  Diff  Annotate
13:2c5a871cf571 2016-09-17 Update libraries File  Diff  Annotate
12:de7b9d98be4b 2016-07-26 Update libraries File  Diff  Annotate
11:4cfe2fa00668 2016-03-08 Update libraries File  Diff  Annotate
10:3e42ca878d11 2016-01-17 Update libraries File  Diff  Annotate
9:0d1a88e54782 2015-10-29 Update libraries File  Diff  Annotate
8:392ad468bdd3 2015-10-03 Update libraries File  Diff  Annotate
7:aecc1c3ea8db 2015-03-26 updated libraries File  Diff  Annotate
6:e8cd76f38fa9 2014-05-09 Fixed the builds URL File  Diff  Annotate
5:0ee0afc66ccd 2014-04-03 Always import the latest mbed SDK build File  Diff  Annotate
2:c30dc3ae7426 2014-03-18 add comment File  Diff  Annotate
1:0e7c9a80e2a6 2014-02-21 Use latest build File  Diff  Annotate
0:7dec7e9ac085 2013-10-11 First commit File  Diff  Annotate