Skip to content
Manpreet Kaur edited this page Sep 27, 2020 · 1 revision

Welcome to the Clock-work wiki! To develop a time clock CODE1: to try a basic digital clock display

The clock will be of HH: MM format with 4 numbers + 1 colon to be displayed. Each number will be a 3x5 dot matrix + one column for spacing. We shall create a canvas of a blank 2D char array of size ROWS = 5, COLUMNS = (3 + 1), i.e., of size 4 * 5 = 20. Then we shall obtain current system time, and extract four digits: HOUR_TENS, HOUR_UNITS, MIN_TENS, MIN_UNITS. Each of these digits is saved on the canvas (i.e., 2D array), at its position determined by the offset. Finally, the array is printed. If the code doesn't compile, try compiling on Visual Studio Express C++ any version.

Clone this wiki locally