TVZ2020 / Mbed OS Semafor_odbrojavanje
Committer:
ssunara
Date:
Sun May 02 16:25:11 2021 +0000
Revision:
0:691f916fe587
Semafor s odbrojavanjem trajanja signalizacije.

Who changed what in which revision?

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