changes the rgb's color depending on the potentiometer

Dependencies:   C12832

Committer:
cheeseondoge
Date:
Fri Feb 12 09:43:31 2021 +0000
Revision:
0:6e9d6c2ce8b0
potentio+rgb

Who changed what in which revision?

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