You will need:
Page last edited October 14, 2012
Text editor powered by tinymce.
Page last edited October 14, 2012
Text editor powered by tinymce.
The main sketch file handles reading the current time and drawing the rectangles. A second file contains the coordinates for each rectangle. The rectangles are broken up into three arrays - hour_rects, minute_rects, & second_rects and ordered by the appropriate time value. The advantage of this approach is that modifying the design of the clock is as easy as adjusting the values in the appropriate array entry. The biggest downside was the increase in memory usage; I ended up keeping the arrays in program memory by declaring the arrays with the prog_uint8_t type and PROGMEM attribute:
prog_uint8_t hour_rects[12][4] PROGMEM = { ... };
prog_uint8_t hour_rects[12][4] PROGMEM = { ... };
pgm_read_byte_near(&rectangles[i][0]);
pgm_read_byte_near(&rectangles[i][0]);
Page last edited October 14, 2012
Text editor powered by tinymce.
Page last edited October 14, 2012
Text editor powered by tinymce.