|
1 |
| -## Alarm example using Mbed OS |
2 |
| - |
3 |
| -This guide reviews the steps required to build and run a basic alarm application on an Mbed OS platform. |
4 |
| - |
5 |
| -Please install [Mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli). |
6 |
| - |
7 |
| -### Import the example application |
8 |
| - |
9 |
| -From the command-line, import the example: |
10 |
| - |
11 |
| -``` |
12 |
| -mbed import mbed-os-example-alarm |
13 |
| -cd mbed-os-example-alarm |
14 |
| -``` |
15 |
| - |
16 |
| -#### Now compile |
17 |
| - |
18 |
| -Invoke `mbed compile`, and specify the name of your platform and your favorite toolchain (`GCC_ARM`, `ARM`, `IAR`). For example, for the ARM Compiler 5: |
19 |
| - |
20 |
| -``` |
21 |
| -mbed compile -m K64F -t ARM |
22 |
| -``` |
23 |
| - |
24 |
| -Your PC may take a few minutes to compile your code. At the end, you see the following result: |
25 |
| - |
26 |
| -``` |
27 |
| -[snip] |
28 |
| -| Module | .text | .data | .bss | |
29 |
| -|----------------------|---------------|-----------|-------------| |
30 |
| -| [lib]/dl7M_tlf.a | 10780(+10780) | 364(+364) | 716(+716) | |
31 |
| -| [lib]/dlpp7M_tl_fc.a | 84(+84) | 0(+0) | 0(+0) | |
32 |
| -| [lib]/m7M_tls.a | 2358(+2358) | 0(+0) | 0(+0) | |
33 |
| -| [lib]/rt7M_tl.a | 1194(+1194) | 0(+0) | 0(+0) | |
34 |
| -| [misc] | 215(+215) | 0(+0) | 0(+0) | |
35 |
| -| main.o | 820(+820) | 0(+0) | 200(+200) | |
36 |
| -| mbed-os/drivers | 490(+490) | 0(+0) | 0(+0) | |
37 |
| -| mbed-os/features | 114(+114) | 0(+0) | 184(+184) | |
38 |
| -| mbed-os/hal | 2070(+2070) | 8(+8) | 132(+132) | |
39 |
| -| mbed-os/platform | 2938(+2938) | 112(+112) | 176(+176) | |
40 |
| -| mbed-os/rtos | 8928(+8928) | 168(+168) | 6437(+6437) | |
41 |
| -| mbed-os/targets | 10174(+10174) | 20(+20) | 1018(+1018) | |
42 |
| -| Subtotals | 40165(+40165) | 672(+672) | 8863(+8863) | |
43 |
| -Total Static RAM memory (data + bss): 9535(+9535) bytes |
44 |
| -Total Flash memory (text + data): 40837(+40837) bytes |
45 |
| -
|
46 |
| -Image: ./BUILD/K64F/IAR/mbed-os-example-alarm.bin |
47 |
| -``` |
48 |
| - |
49 |
| -#### Program your board |
50 |
| - |
51 |
| -1. Connect your Mbed device to the computer over USB. |
52 |
| -1. Copy the binary file to the Mbed device. |
53 |
| -1. Press the reset button to start the program. |
54 |
| -1. Press **Button1** for the number of desired hours to delay. Press **Button2** to cycle to minutes, and repeat the previous step for the number of desired minutes. |
55 |
| -1. Press **Button2** again to start the alarm. |
56 |
| -1. Press **Button2** again once the alarm triggers to silence it. Both an LED and a digital out pin will go high on the alarm trigger and go back low on an alarm reset. |
57 |
| - |
58 |
| -### Troubleshooting |
59 |
| - |
60 |
| -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. |
| 1 | +To see this example in context, please see its [published documentation](https://os.mbed.com/docs/mbed-os/latest/tutorials/alarm-tutorial.html). |
0 commit comments