Demo touching the perimeter of a circle

Dependencies:   RA8875

Committer:
WiredHome
Date:
Sun Apr 04 16:50:35 2021 +0000
Revision:
0:f2a6447e607c
New demo for touching the perimeter of a circle

Who changed what in which revision?

UserRevisionLine numberNew contents of line
WiredHome 0:f2a6447e607c 1 ![](./resources/official_armmbed_example_badge.png)
WiredHome 0:f2a6447e607c 2 # Blinky Mbed OS example
WiredHome 0:f2a6447e607c 3
WiredHome 0:f2a6447e607c 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/).
WiredHome 0:f2a6447e607c 5
WiredHome 0:f2a6447e607c 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).
WiredHome 0:f2a6447e607c 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).)
WiredHome 0:f2a6447e607c 8
WiredHome 0:f2a6447e607c 9 1. [Install Mbed CLI](https://os.mbed.com/docs/mbed-os/latest/quick-start/offline-with-mbed-cli.html).
WiredHome 0:f2a6447e607c 10
WiredHome 0:f2a6447e607c 11 1. Clone this repository on your system, and change the current directory to where the project was cloned:
WiredHome 0:f2a6447e607c 12
WiredHome 0:f2a6447e607c 13 ```bash
WiredHome 0:f2a6447e607c 14 $ git clone git@github.com:armmbed/mbed-os-example-blinky && cd mbed-os-example-blinky
WiredHome 0:f2a6447e607c 15 ```
WiredHome 0:f2a6447e607c 16
WiredHome 0:f2a6447e607c 17 Alternatively, you can download the example project with Arm Mbed CLI using the `import` subcommand:
WiredHome 0:f2a6447e607c 18
WiredHome 0:f2a6447e607c 19 ```bash
WiredHome 0:f2a6447e607c 20 $ mbed import mbed-os-example-blinky && cd mbed-os-example-blinky
WiredHome 0:f2a6447e607c 21 ```
WiredHome 0:f2a6447e607c 22
WiredHome 0:f2a6447e607c 23
WiredHome 0:f2a6447e607c 24 ## Application functionality
WiredHome 0:f2a6447e607c 25
WiredHome 0:f2a6447e607c 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.
WiredHome 0:f2a6447e607c 27
WiredHome 0:f2a6447e607c 28 ## Building and running
WiredHome 0:f2a6447e607c 29
WiredHome 0:f2a6447e607c 30 1. Connect a USB cable between the USB port on the board and the host computer.
WiredHome 0:f2a6447e607c 31 2. <a name="build_cmd"></a> Run the following command to build the example project and program the microcontroller flash memory:
WiredHome 0:f2a6447e607c 32 ```bash
WiredHome 0:f2a6447e607c 33 $ mbed compile -m <TARGET> -t <TOOLCHAIN> --flash
WiredHome 0:f2a6447e607c 34 ```
WiredHome 0:f2a6447e607c 35 The binary is located at `./BUILD/<TARGET>/<TOOLCHAIN>/mbed-os-example-blinky.bin`.
WiredHome 0:f2a6447e607c 36
WiredHome 0:f2a6447e607c 37 Alternatively, you can manually copy the binary to the board, which you mount on the host computer over USB.
WiredHome 0:f2a6447e607c 38
WiredHome 0:f2a6447e607c 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:
WiredHome 0:f2a6447e607c 40
WiredHome 0:f2a6447e607c 41 ```bash
WiredHome 0:f2a6447e607c 42 $ mbed compile -S
WiredHome 0:f2a6447e607c 43 ```
WiredHome 0:f2a6447e607c 44
WiredHome 0:f2a6447e607c 45 ## Expected output
WiredHome 0:f2a6447e607c 46 The LED on your target turns on and off every 500 milliseconds.
WiredHome 0:f2a6447e607c 47
WiredHome 0:f2a6447e607c 48
WiredHome 0:f2a6447e607c 49 ## Troubleshooting
WiredHome 0:f2a6447e607c 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.
WiredHome 0:f2a6447e607c 51
WiredHome 0:f2a6447e607c 52 ## Related Links
WiredHome 0:f2a6447e607c 53
WiredHome 0:f2a6447e607c 54 * [Mbed OS Stats API](https://os.mbed.com/docs/latest/apis/mbed-statistics.html).
WiredHome 0:f2a6447e607c 55 * [Mbed OS Configuration](https://os.mbed.com/docs/latest/reference/configuration.html).
WiredHome 0:f2a6447e607c 56 * [Mbed OS Serial Communication](https://os.mbed.com/docs/latest/tutorials/serial-communication.html).
WiredHome 0:f2a6447e607c 57 * [Mbed OS bare metal](https://os.mbed.com/docs/mbed-os/latest/reference/mbed-os-bare-metal.html).
WiredHome 0:f2a6447e607c 58 * [Mbed boards](https://os.mbed.com/platforms/).
WiredHome 0:f2a6447e607c 59
WiredHome 0:f2a6447e607c 60 ### License and contributions
WiredHome 0:f2a6447e607c 61
WiredHome 0:f2a6447e607c 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.
WiredHome 0:f2a6447e607c 63
WiredHome 0:f2a6447e607c 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.