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.
History
Backed out changeset c76594f491f2
2019-04-08, by James Cox-Morton [Mon, 08 Apr 2019 11:03:25 +0100] rev 24
Backed out changeset c76594f491f2
Hg test
2019-04-08, by James Cox-Morton [Mon, 08 Apr 2019 10:47:57 +0100] rev 23
Hg test
Update libraries
2019-02-12, by MACRUM [Tue, 12 Feb 2019 01:45:59 +0000] rev 22
Update libraries
Update libraries
2018-09-11, by MACRUM [Tue, 11 Sep 2018 01:34:25 +0000] rev 21
Update libraries
Update libraries
2018-03-05, by MACRUM [Mon, 05 Mar 2018 00:46:55 +0000] rev 20
Update libraries
Update libraries
2017-12-25, by MACRUM [Mon, 25 Dec 2017 03:11:29 +0000] rev 19
Update libraries
Update libraries
2017-10-12, by MACRUM [Thu, 12 Oct 2017 04:41:05 +0000] rev 18
Update libraries
Update libraries
2017-08-01, by MACRUM [Tue, 01 Aug 2017 05:00:31 +0000] rev 17
Update libraries
Update libraries
2017-05-12, by MACRUM [Fri, 12 May 2017 11:06:33 +0000] rev 16
Update libraries
Update libraries
2017-01-18, by MACRUM [Wed, 18 Jan 2017 13:46:04 +0000] rev 15
Update libraries