ECE595 - Lab 3 Part 2 - Slider Potentiometer Program - TA

Committer:
priyank12p
Date:
Sat Jan 16 00:53:52 2021 +0000
Revision:
2:adc51888ece5
Parent:
0:4cb6e9d0da34
Initial Commit

Who changed what in which revision?

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