![](/media/cache/group/IMG_0300.JPG.50x50_q85.jpg)
Our clock project
Dependencies: SPI_TFT_ILI9341 TFT_fonts Adafruit_RTCLib RTC-DS1307 TSI
IoT Clock
We have been given a task to design a clock with internet features, the 'Internet Clock'. First of all, we identified what features we want:
Display: Split into 4 parts:
- Analogue clock - the good ol' fashioned circle display, complete with minute, hour and second hands.
- Digital clock - equipped with date for the modern human.
- Weather display - for those who cannot be bothered to look out of the window.
- Alarm - just what you need when you have to get up or be somewhere.
Wifi module:
- For collecting data for weather, alarm times and so it can be an 'Internet Clock'.
Speaker:
- To make the annoying sound to let you know your alarm is going off.
Range finder:
- To wave your hand in front of to turn the alarm off, because pressing a button is too last centurary.
The roles:
- Soroush's first task was to get the LCD screen to work. Meanwhile Adam sorted out the speaker system.
- When these were done, Adam worked on the screen to display a clock face and date/year. Soroush then connected the wifi module to extract data for weather, location and date.
Connecting the wifi module.
- The next part was to get the range-finder hooked up and responding to a hand passing, and switch the alarm off.
- Finally, it was time for assembly.
Difficulties:
There were many issues faced throughout the project. First of all, Adam's coding knowledge was a lot less than Soroush's which slowed down some completion of tasks. Although, this did help us sort out the roles.
Next was the wifi connectivity which caused several problems during the project, and we couldn't get the connection or fetch data, which further slowed the process. Another difficulty was finding the range-finder's set-up page for mbed.
However, when we got past these set backs we managed to put everything together quickly,
All the hardware wired in.
Outcome:
- Our LCD screen has 2 displays:
- 1 An analogue clock filling the screen.
- 2 An analogue clock, date and year, weather and location, and alarm time.
This is changed by holding (not passing quickly) your hand in front of the range-finder.
- An RTC to keep track of the time rather than collecting the information from then internet. However, we have had a lot of problems setting this up, and it doesn't seem to respond.
- Wifi is also not connected, so we have the default date, time, weather and location.
- You are able to change the alarm time by swiping the touch pad on the back.
Perhaps given more time we'd be able to fix these problems. But a key point is that we have got all the other features working, except the correct time.
README.md@0:07e2cda84b51, 2017-05-23 (annotated)
- Committer:
- sfaghihi
- Date:
- Tue May 23 10:08:53 2017 +0000
- Revision:
- 0:07e2cda84b51
hi
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sfaghihi | 0:07e2cda84b51 | 1 | # Getting started with Blinky on mbed OS |
sfaghihi | 0:07e2cda84b51 | 2 | |
sfaghihi | 0:07e2cda84b51 | 3 | This guide reviews the steps required to get Blinky working on an mbed OS platform. |
sfaghihi | 0:07e2cda84b51 | 4 | |
sfaghihi | 0:07e2cda84b51 | 5 | Please install [mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli). |
sfaghihi | 0:07e2cda84b51 | 6 | |
sfaghihi | 0:07e2cda84b51 | 7 | ## Import the example application |
sfaghihi | 0:07e2cda84b51 | 8 | |
sfaghihi | 0:07e2cda84b51 | 9 | From the command-line, import the example: |
sfaghihi | 0:07e2cda84b51 | 10 | |
sfaghihi | 0:07e2cda84b51 | 11 | ``` |
sfaghihi | 0:07e2cda84b51 | 12 | mbed import mbed-os-example-blinky |
sfaghihi | 0:07e2cda84b51 | 13 | cd mbed-os-example-blinky |
sfaghihi | 0:07e2cda84b51 | 14 | ``` |
sfaghihi | 0:07e2cda84b51 | 15 | |
sfaghihi | 0:07e2cda84b51 | 16 | ### Now compile |
sfaghihi | 0:07e2cda84b51 | 17 | |
sfaghihi | 0:07e2cda84b51 | 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: |
sfaghihi | 0:07e2cda84b51 | 19 | |
sfaghihi | 0:07e2cda84b51 | 20 | ``` |
sfaghihi | 0:07e2cda84b51 | 21 | mbed compile -m K64F -t ARM |
sfaghihi | 0:07e2cda84b51 | 22 | ``` |
sfaghihi | 0:07e2cda84b51 | 23 | |
sfaghihi | 0:07e2cda84b51 | 24 | Your PC may take a few minutes to compile your code. At the end, you see the following result: |
sfaghihi | 0:07e2cda84b51 | 25 | |
sfaghihi | 0:07e2cda84b51 | 26 | ``` |
sfaghihi | 0:07e2cda84b51 | 27 | [snip] |
sfaghihi | 0:07e2cda84b51 | 28 | +----------------------------+-------+-------+------+ |
sfaghihi | 0:07e2cda84b51 | 29 | | Module | .text | .data | .bss | |
sfaghihi | 0:07e2cda84b51 | 30 | +----------------------------+-------+-------+------+ |
sfaghihi | 0:07e2cda84b51 | 31 | | Misc | 13939 | 24 | 1372 | |
sfaghihi | 0:07e2cda84b51 | 32 | | core/hal | 16993 | 96 | 296 | |
sfaghihi | 0:07e2cda84b51 | 33 | | core/rtos | 7384 | 92 | 4204 | |
sfaghihi | 0:07e2cda84b51 | 34 | | features/FEATURE_IPV4 | 80 | 0 | 176 | |
sfaghihi | 0:07e2cda84b51 | 35 | | frameworks/greentea-client | 1830 | 60 | 44 | |
sfaghihi | 0:07e2cda84b51 | 36 | | frameworks/utest | 2392 | 512 | 292 | |
sfaghihi | 0:07e2cda84b51 | 37 | | Subtotals | 42618 | 784 | 6384 | |
sfaghihi | 0:07e2cda84b51 | 38 | +----------------------------+-------+-------+------+ |
sfaghihi | 0:07e2cda84b51 | 39 | Allocated Heap: unknown |
sfaghihi | 0:07e2cda84b51 | 40 | Allocated Stack: unknown |
sfaghihi | 0:07e2cda84b51 | 41 | Total Static RAM memory (data + bss): 7168 bytes |
sfaghihi | 0:07e2cda84b51 | 42 | Total RAM memory (data + bss + heap + stack): 7168 bytes |
sfaghihi | 0:07e2cda84b51 | 43 | Total Flash memory (text + data + misc): 43402 bytes |
sfaghihi | 0:07e2cda84b51 | 44 | Image: .\.build\K64F\ARM\mbed-os-example-blinky.bin |
sfaghihi | 0:07e2cda84b51 | 45 | ``` |
sfaghihi | 0:07e2cda84b51 | 46 | |
sfaghihi | 0:07e2cda84b51 | 47 | ### Program your board |
sfaghihi | 0:07e2cda84b51 | 48 | |
sfaghihi | 0:07e2cda84b51 | 49 | 1. Connect your mbed device to the computer over USB. |
sfaghihi | 0:07e2cda84b51 | 50 | 1. Copy the binary file to the mbed device. |
sfaghihi | 0:07e2cda84b51 | 51 | 1. Press the reset button to start the program. |
sfaghihi | 0:07e2cda84b51 | 52 | |
sfaghihi | 0:07e2cda84b51 | 53 | The LED on your platform turns on and off. |
sfaghihi | 0:07e2cda84b51 | 54 | |
sfaghihi | 0:07e2cda84b51 | 55 | ## Export the project to Keil MDK, and debug your application |
sfaghihi | 0:07e2cda84b51 | 56 | |
sfaghihi | 0:07e2cda84b51 | 57 | From the command-line, run the following command: |
sfaghihi | 0:07e2cda84b51 | 58 | |
sfaghihi | 0:07e2cda84b51 | 59 | ``` |
sfaghihi | 0:07e2cda84b51 | 60 | mbed export -m K64F -i uvision |
sfaghihi | 0:07e2cda84b51 | 61 | ``` |
sfaghihi | 0:07e2cda84b51 | 62 | |
sfaghihi | 0:07e2cda84b51 | 63 | To debug the application: |
sfaghihi | 0:07e2cda84b51 | 64 | |
sfaghihi | 0:07e2cda84b51 | 65 | 1. Start uVision. |
sfaghihi | 0:07e2cda84b51 | 66 | 1. Import the uVision project generated earlier. |
sfaghihi | 0:07e2cda84b51 | 67 | 1. Compile your application, and generate an `.axf` file. |
sfaghihi | 0:07e2cda84b51 | 68 | 1. Make sure uVision is configured to debug over CMSIS-DAP (From the Project menu > Options for Target '...' > Debug tab > Use CMSIS-DAP Debugger). |
sfaghihi | 0:07e2cda84b51 | 69 | 1. Set breakpoints, and start a debug session. |
sfaghihi | 0:07e2cda84b51 | 70 | |
sfaghihi | 0:07e2cda84b51 | 71 | ![Image of uVision](img/uvision.png) |
sfaghihi | 0:07e2cda84b51 | 72 | |
sfaghihi | 0:07e2cda84b51 | 73 | ## Troubleshooting |
sfaghihi | 0:07e2cda84b51 | 74 | |
sfaghihi | 0:07e2cda84b51 | 75 | 1. Make sure `mbed-cli` is working correctly and its version is `>1.0.0` |
sfaghihi | 0:07e2cda84b51 | 76 | |
sfaghihi | 0:07e2cda84b51 | 77 | ``` |
sfaghihi | 0:07e2cda84b51 | 78 | mbed --version |
sfaghihi | 0:07e2cda84b51 | 79 | ``` |
sfaghihi | 0:07e2cda84b51 | 80 | |
sfaghihi | 0:07e2cda84b51 | 81 | If not, you can update it: |
sfaghihi | 0:07e2cda84b51 | 82 | |
sfaghihi | 0:07e2cda84b51 | 83 | ``` |
sfaghihi | 0:07e2cda84b51 | 84 | pip install mbed-cli --upgrade |
sfaghihi | 0:07e2cda84b51 | 85 | ``` |
sfaghihi | 0:07e2cda84b51 | 86 | |
sfaghihi | 0:07e2cda84b51 | 87 | 2. If using Keil MDK, make sure you have a license installed. [MDK-Lite](http://www.keil.com/arm/mdk.asp) has a 32 KB restriction on code size. |