O'Reilly logo

ARM® Cortex® M4 Cookbook by Dr. Mark Fisher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using timers to create a digital clock

A digital clock application provides a good platform to illustrate the components that we discussed in this chapter. We'll use PuTTY to allow the user to set the time and then call HAL_GetTick () to provide a time-base for our digital clock that is displayed on the GLCD. We'll call this recipe ticToc_c3v0.

How to do it…

Follow the following steps to create a digital clock:

  1. Create a new folder for the ticToc_c3v0 recipe and, within it, a new project (ticToc) and use the RTE manager to select board support for Graphic LCD.
  2. Copy the retarget.c, serial.c and serial.h files to the project folder and add them to the project.
  3. Define a new type (time_t) in the ticToc.h header file. Please note that we could declare each ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required