Simple Click Buzzer example for Hexiwear

Dependencies:   PWM_Tone_Library

This project demonstrates the use of the Mikroelektronika Click Buzzer module with hexiwear

Plug Hexiwear into the Docking Station and the BUZZER Click to the Click Socket 1
Connect the USB cable to your computer and to the micro-USB port of the Docking Station

Compile the project and copy the binary "Hexi_Click_Buzzer_Example_HEXIWEAR.bin" in the DAP-LINK drive from your computer file explorer
Press the K64F-RESET button on the docking station to start the program on your board

The buzzer will start play a melody of 32 tones

/media/uploads/GregC/hexi_click_buzzer.jpg

Committer:
GregC
Date:
Tue Sep 20 23:21:55 2016 +0000
Revision:
0:13eb53d1b502
Click Buzzer example for Hexiwear

Who changed what in which revision?

UserRevisionLine numberNew contents of line
GregC 0:13eb53d1b502 1 # Getting started with Blinky on mbed OS
GregC 0:13eb53d1b502 2
GregC 0:13eb53d1b502 3 This is a very simple guide, reviewing the steps required to get Blinky working on an mbed OS platform.
GregC 0:13eb53d1b502 4
GregC 0:13eb53d1b502 5 Please install [mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli).
GregC 0:13eb53d1b502 6
GregC 0:13eb53d1b502 7 ## Get the example application!
GregC 0:13eb53d1b502 8
GregC 0:13eb53d1b502 9 From the command line, import the example:
GregC 0:13eb53d1b502 10
GregC 0:13eb53d1b502 11 ```
GregC 0:13eb53d1b502 12 mbed import mbed-os-example-blinky
GregC 0:13eb53d1b502 13 cd mbed-os-example-blinky
GregC 0:13eb53d1b502 14 ```
GregC 0:13eb53d1b502 15
GregC 0:13eb53d1b502 16 ### Now compile
GregC 0:13eb53d1b502 17
GregC 0:13eb53d1b502 18 Invoke `mbed compile` specifying the name of your platform and your favorite toolchain (`GCC_ARM`, `ARM`, `IAR`). For example, for the ARM Compiler 5:
GregC 0:13eb53d1b502 19
GregC 0:13eb53d1b502 20 ```
GregC 0:13eb53d1b502 21 mbed compile -m K64F -t ARM
GregC 0:13eb53d1b502 22 ```
GregC 0:13eb53d1b502 23
GregC 0:13eb53d1b502 24 Your PC may take a few minutes to compile your code. At the end you should get the following result:
GregC 0:13eb53d1b502 25
GregC 0:13eb53d1b502 26 ```
GregC 0:13eb53d1b502 27 [snip]
GregC 0:13eb53d1b502 28 +----------------------------+-------+-------+------+
GregC 0:13eb53d1b502 29 | Module | .text | .data | .bss |
GregC 0:13eb53d1b502 30 +----------------------------+-------+-------+------+
GregC 0:13eb53d1b502 31 | Misc | 13939 | 24 | 1372 |
GregC 0:13eb53d1b502 32 | core/hal | 16993 | 96 | 296 |
GregC 0:13eb53d1b502 33 | core/rtos | 7384 | 92 | 4204 |
GregC 0:13eb53d1b502 34 | features/FEATURE_IPV4 | 80 | 0 | 176 |
GregC 0:13eb53d1b502 35 | frameworks/greentea-client | 1830 | 60 | 44 |
GregC 0:13eb53d1b502 36 | frameworks/utest | 2392 | 512 | 292 |
GregC 0:13eb53d1b502 37 | Subtotals | 42618 | 784 | 6384 |
GregC 0:13eb53d1b502 38 +----------------------------+-------+-------+------+
GregC 0:13eb53d1b502 39 Allocated Heap: unknown
GregC 0:13eb53d1b502 40 Allocated Stack: unknown
GregC 0:13eb53d1b502 41 Total Static RAM memory (data + bss): 7168 bytes
GregC 0:13eb53d1b502 42 Total RAM memory (data + bss + heap + stack): 7168 bytes
GregC 0:13eb53d1b502 43 Total Flash memory (text + data + misc): 43402 bytes
GregC 0:13eb53d1b502 44 Image: .\.build\K64F\ARM\mbed-os-example-blinky.bin
GregC 0:13eb53d1b502 45 ```
GregC 0:13eb53d1b502 46
GregC 0:13eb53d1b502 47 ### Program your board
GregC 0:13eb53d1b502 48
GregC 0:13eb53d1b502 49 1. Connect your mbed device to the computer over USB.
GregC 0:13eb53d1b502 50 1. Copy the binary file to the mbed device .
GregC 0:13eb53d1b502 51 1. Press the reset button to start the program.
GregC 0:13eb53d1b502 52
GregC 0:13eb53d1b502 53 You should see the LED of your platform turning on and off.
GregC 0:13eb53d1b502 54
GregC 0:13eb53d1b502 55 Congratulations if you managed to complete this test!
GregC 0:13eb53d1b502 56
GregC 0:13eb53d1b502 57 ## Export the project to Keil MDK and debug your application
GregC 0:13eb53d1b502 58
GregC 0:13eb53d1b502 59 From the command line, run the following command:
GregC 0:13eb53d1b502 60
GregC 0:13eb53d1b502 61 ```
GregC 0:13eb53d1b502 62 mbed export -m K64F -i uvision
GregC 0:13eb53d1b502 63 ```
GregC 0:13eb53d1b502 64
GregC 0:13eb53d1b502 65 You should see the following output:
GregC 0:13eb53d1b502 66
GregC 0:13eb53d1b502 67 ```
GregC 0:13eb53d1b502 68 Successful exports:
GregC 0:13eb53d1b502 69 * K64F::uvision .\projectfiles\uvision_K64F\Unnamed_Project
GregC 0:13eb53d1b502 70 ```
GregC 0:13eb53d1b502 71
GregC 0:13eb53d1b502 72 To debug the application:
GregC 0:13eb53d1b502 73
GregC 0:13eb53d1b502 74 1. Start uVision.
GregC 0:13eb53d1b502 75 1. Import the uVision project generated earlier.
GregC 0:13eb53d1b502 76 1. Compile your application and generate an `.axf` file.
GregC 0:13eb53d1b502 77 1. Make sure uVision is configured to debug over CMSIS-DAP (From the Project menu > Options for Target '...' > Debug tab > Use CMSIS-DAP Debugger).
GregC 0:13eb53d1b502 78 1. Set breakpoints and start a debug session.
GregC 0:13eb53d1b502 79
GregC 0:13eb53d1b502 80 ![Image of uVision](img/uvision.png)
GregC 0:13eb53d1b502 81
GregC 0:13eb53d1b502 82 ## Troubleshooting
GregC 0:13eb53d1b502 83
GregC 0:13eb53d1b502 84 1. Make sure `mbed-cli` is working correctly and its version is greater than `0.8.9`
GregC 0:13eb53d1b502 85
GregC 0:13eb53d1b502 86 ```
GregC 0:13eb53d1b502 87 mbed --version
GregC 0:13eb53d1b502 88 ```
GregC 0:13eb53d1b502 89
GregC 0:13eb53d1b502 90 If not, you can update it easily:
GregC 0:13eb53d1b502 91
GregC 0:13eb53d1b502 92 ```
GregC 0:13eb53d1b502 93 pip install mbed-cli --upgrade
GregC 0:13eb53d1b502 94 ```
GregC 0:13eb53d1b502 95
GregC 0:13eb53d1b502 96 2. If using Keil MDK, make sure you have a license installed. [MDK-Lite](http://www.keil.com/arm/mdk.asp) has a 32KB restriction on code size.