Sklop koji spaja rad LED-ica i piezzo buzzera stvarajući Božićni ugođaj. 3 LED diode predstavljaju lampice za bor te svijetle izmjenicno. Piezzo buzzer služi za konstantno sviranje božićnih pjesama (Santa claus is coming to town, Jingle Bells, We wish you a merry Christmas). Svakim tonom koji se odsvira na piezzo buzzeru LED-ice naprave jedan krug svijetljenja stvarajući dojam lampica za bor. User_Button tipkalo na pločici zaustavlja rad lampica na 5sek, a integrirana zelena LD2 pokazuje ispravnost programa tako što koristi ticker, te svijetli u intervalima 1 sek.

Dependencies:   buzzer

https://os.mbed.com/media/uploads/nzigic/mikro_led_bozicne_lampice_800.jpg

Committer:
nzigic
Date:
Thu Nov 26 16:23:40 2020 +0000
Revision:
0:3af3d8a1d741
Programski rad Mikroupravljaci

Who changed what in which revision?

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