.

Dependencies:   mbed C12832 LM75B

Committer:
jojofannum69
Date:
Wed Oct 13 13:51:26 2021 +0000
Revision:
0:8bf954873391
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jojofannum69 0:8bf954873391 1 ![](./resources/official_armmbed_example_badge.png)
jojofannum69 0:8bf954873391 2 # Blinky Mbed OS example
jojofannum69 0:8bf954873391 3
jojofannum69 0:8bf954873391 4 The example project is part of the [Arm Mbed OS Official Examples](https://os.mbed.com/code/) and is the [getting started example for Mbed OS](https://os.mbed.com/docs/mbed-os/v5.14/quick-start/index.html). It contains an application that repeatedly blinks an LED on supported [Mbed boards](https://os.mbed.com/platforms/).
jojofannum69 0:8bf954873391 5
jojofannum69 0:8bf954873391 6 You can build the project with all supported [Mbed OS build tools](https://os.mbed.com/docs/mbed-os/latest/tools/index.html). However, this example project specifically refers to the command-line interface tool [Arm Mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli).
jojofannum69 0:8bf954873391 7 (Note: To see a rendered example you can import into the Arm Online Compiler, please see our [import quick start](https://os.mbed.com/docs/mbed-os/latest/quick-start/online-with-the-online-compiler.html#importing-the-code).)
jojofannum69 0:8bf954873391 8
jojofannum69 0:8bf954873391 9 1. [Install Mbed CLI](https://os.mbed.com/docs/mbed-os/latest/quick-start/offline-with-mbed-cli.html).
jojofannum69 0:8bf954873391 10
jojofannum69 0:8bf954873391 11 1. Clone this repository on your system, and change the current directory to where the project was cloned:
jojofannum69 0:8bf954873391 12
jojofannum69 0:8bf954873391 13 ```bash
jojofannum69 0:8bf954873391 14 $ git clone git@github.com:armmbed/mbed-os-example-blinky && cd mbed-os-example-blinky
jojofannum69 0:8bf954873391 15 ```
jojofannum69 0:8bf954873391 16
jojofannum69 0:8bf954873391 17 Alternatively, you can download the example project with Arm Mbed CLI using the `import` subcommand:
jojofannum69 0:8bf954873391 18
jojofannum69 0:8bf954873391 19 ```bash
jojofannum69 0:8bf954873391 20 $ mbed import mbed-os-example-blinky && cd mbed-os-example-blinky
jojofannum69 0:8bf954873391 21 ```
jojofannum69 0:8bf954873391 22
jojofannum69 0:8bf954873391 23
jojofannum69 0:8bf954873391 24 ## Application functionality
jojofannum69 0:8bf954873391 25
jojofannum69 0:8bf954873391 26 The `main()` function is the single thread in the application. It toggles the state of a digital output connected to an LED on the board.
jojofannum69 0:8bf954873391 27
jojofannum69 0:8bf954873391 28 ## Building and running
jojofannum69 0:8bf954873391 29
jojofannum69 0:8bf954873391 30 1. Connect a USB cable between the USB port on the board and the host computer.
jojofannum69 0:8bf954873391 31 2. <a name="build_cmd"></a> Run the following command to build the example project and program the microcontroller flash memory:
jojofannum69 0:8bf954873391 32 ```bash
jojofannum69 0:8bf954873391 33 $ mbed compile -m <TARGET> -t <TOOLCHAIN> --flash
jojofannum69 0:8bf954873391 34 ```
jojofannum69 0:8bf954873391 35 The binary is located at `./BUILD/<TARGET>/<TOOLCHAIN>/mbed-os-example-blinky.bin`.
jojofannum69 0:8bf954873391 36
jojofannum69 0:8bf954873391 37 Alternatively, you can manually copy the binary to the board, which you mount on the host computer over USB.
jojofannum69 0:8bf954873391 38
jojofannum69 0:8bf954873391 39 Depending on the target, you can build the example project with the `GCC_ARM`, `ARM` or `IAR` toolchain. After installing Arm Mbed CLI, run the command below to determine which toolchain supports your target:
jojofannum69 0:8bf954873391 40
jojofannum69 0:8bf954873391 41 ```bash
jojofannum69 0:8bf954873391 42 $ mbed compile -S
jojofannum69 0:8bf954873391 43 ```
jojofannum69 0:8bf954873391 44
jojofannum69 0:8bf954873391 45 ## Expected output
jojofannum69 0:8bf954873391 46 The LED on your target turns on and off every 500 milliseconds.
jojofannum69 0:8bf954873391 47
jojofannum69 0:8bf954873391 48
jojofannum69 0:8bf954873391 49 ## Troubleshooting
jojofannum69 0:8bf954873391 50 If you have problems, you can review the [documentation](https://os.mbed.com/docs/latest/tutorials/debugging.html) for suggestions on what could be wrong and how to fix it.
jojofannum69 0:8bf954873391 51
jojofannum69 0:8bf954873391 52 ## Related Links
jojofannum69 0:8bf954873391 53
jojofannum69 0:8bf954873391 54 * [Mbed OS Stats API](https://os.mbed.com/docs/latest/apis/mbed-statistics.html).
jojofannum69 0:8bf954873391 55 * [Mbed OS Configuration](https://os.mbed.com/docs/latest/reference/configuration.html).
jojofannum69 0:8bf954873391 56 * [Mbed OS Serial Communication](https://os.mbed.com/docs/latest/tutorials/serial-communication.html).
jojofannum69 0:8bf954873391 57 * [Mbed OS bare metal](https://os.mbed.com/docs/mbed-os/latest/reference/mbed-os-bare-metal.html).
jojofannum69 0:8bf954873391 58 * [Mbed boards](https://os.mbed.com/platforms/).
jojofannum69 0:8bf954873391 59
jojofannum69 0:8bf954873391 60 ### License and contributions
jojofannum69 0:8bf954873391 61
jojofannum69 0:8bf954873391 62 The software is provided under Apache-2.0 license. Contributions to this project are accepted under the same license. Please see contributing.md for more info.
jojofannum69 0:8bf954873391 63
jojofannum69 0:8bf954873391 64 This project contains code from other projects. The original license text is included in those source files. They must comply with our license guide.