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