gloveboxes / Windows-IoT-Core-Graphics-Library

Graphics Lib to draw, scroll & control text or symbols on multiple 8x8 LED Matrices and 7 Segment Displays (on MAX7219). Supports HT16K33 & MAX7219 LED Driver chips
24 stars 13 forks source link

Clock #4

Closed mezzo86 closed 3 years ago

mezzo86 commented 8 years ago

Hello there,

First of all thank you for the glovebox library. I have a MAX7219 chain with 8 panels and I would like to simply show he current time. The only thing I was able to get to run so far is a scollingtext 'Hello World'.

Can you please give me a hint how I can show the current time without scrolling?

Thanks, mezzo

jrabarton commented 8 years ago

you could draw the time like this.

char[] datetime = DateTime.Now.ToLocalTime().AddHours(1).ToString("HHmm").ToCharArray();
for (int i = 0; i < datetime.Length; i++)
    matrix.DrawString(datetime[i].ToString(), 0, i);
mezzo86 commented 8 years ago

Thanks Jrabarton, this is working well and the LEDs are now displaying the time. I added "ss" to "HHmmss" to display the seconds. Can you help me to understand how I can get the clock 'ticking'? Should I use a timer or while loop?