Tag Archives: Software

“Feels hotter than that”. Humidex to the rescue.

HEAT WARNING IN EFFECT   Ottawa and surrounding areas are in the news at the moment for breaking summer temperature records. According to Environment Canada, Just yesterday (Wed. 29 July, 2015) Ottawa broke a 66 year-old record high of 33.3°C set in 1949, recording a temperature of 33.9°C “feeling like 41 with the humidity.” Our local CBC weatherman, Ian Black, tweeted “…Humidex right now is 42!”

Yes, it was a scorcher! I should know as I was in Ottawa and at noon was outside listlessly dragging the lawnmower over our scorched patch of curbside grass!

OK, so it was very hot but I was curious how a temperature of 33.9°C at 47% humidity feels like (a humidex of) 42? But what is HUMIDEX anyway?

Continue reading

Graphic LCD Analogue Clock

In a previous article about the 192×64 pixel Graphics LCD Module that I have been playing with, I created a simple analogue clock to exercise some of the text and graphics functions of the fully-featured openGLCD library. I have now added to the functions of the clock to include moon-phases and local times of both sunrise and sunset, all of which are displayed using a combination of bitmaps and text. In addition, I have also added the sun’s elevation, in degrees from the horizontal, and sun’s azimuth, displayed in both polar degrees (North=0°) and text-based cardinal direction.

Analogue Clock with moon phase, sunset, sunrise and sun elevation and azimuth

Analogue Clock with moon phase, sunset, sunrise and sun elevation and azimuth

REVISION [150507]: I have now added the times of moon rise and moon set, and marks on the outer ring of the analogue clock for sun elevation (tick mark) and compass-based azimuth (open circle). However, these additions came at a price – removal of all bitmap icons.

Revision of the Analogue Clock with sun elevation and azimuth, moon phase, and times of sunrise, solar noon, sunset, moon rise and moon set

Revision of the Analogue Clock with sun elevation and azimuth, moon phase and state, and times of sunrise, solar noon, sunset, moon rise and moon set.

REVISION [150517]: Added icons for moon phase (shown as waning crescent) and made minor alterations to clock face. On the clock face, the inner filled circle is the seconds marker, the outer filled circle is the sun’s cardinal azimuth (shown as 101° East) and the tick mark (close to 2 o’clock) is the sun’s elevation to the horizontal (shown as 37°). The revisions to the Arduino code are included below.

Analogue clock with additional moon phase icons

Analogue clock with additional moon phase icons

Take your pick!

Continue reading

Calculating day of the week

While adding software to perform an automatic adjustment of Daylight Savings Time to my clocks, I came across a problem. My GPS-powered gpSKY CLOCK does not contain a real-time clock. So? Well, the algorithm I used for determining whether or not a date is within Daylight Savings Time (from 2am on the 2nd Sunday in March to 2am on the 1st Sunday in November) relies on knowing the day of the week (0-Sunday, 1-Monday etc.) – data that is automatically calculated by the RTC.

So, I had to determine the day of the week in the gpsSKY CLOCK by other means. Trawling the Internet I came across many different calculations, most of which were complex and almost impossible to follow. However, I found an algorithm that is elegant, small and relatively simple. According to Wikipedia, this algorithm is based on work in 1990 by Michael Keith and Tom Craver and revised into its current form Tomohiko Sakamoto in 1993. Apparently it is accurate for any Gregorian date.

// dow() returns byte containing numeric day of the week [0-Sunday, 1-Monday etc.]
byte dow(int y, int m, int d) {
       static int t[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4};
       y -= m < 3;
       return (y + y/4 - y/100 + y/400 + t[m-1] + d) % 7;
}

Elegantly simple; simply elegant!

Daylight Saving Time… simplified

So, I don’t know about you but I have a ton of clocks. So last Sunday, at the start of Daylight Saving Time (DST), every one of my @#$% clocks had to be adjusted manually. What a pain!

Now, I love making clocks and I also love trying to solve problems, so inevitably this led to finding a simple way to automatically set the clock forward at DST and backward again for the return to Standard Time (ST). Here’s how it’s done….

Continue reading

3 & 4-line Big Font Numerals

As an extension to the large numeral fonts for 4-line LCD displays, I have added a set of 3-line LCD numerals that can be combined at will. Both the 4-line and 3-line numbers 0 to 9 use combinations of the the same set of 8 glyphs. The 3- and 4-line height font design make the numerals both easy to differentiate and easy to read at a distance and ideal for displays that benefit from highlighting some numbers.

To illustrate the combination of 3-line and 4-line high fonts, large numbers are used to display the time from a software-derived clock. The hours and minutes are displayed in 3-line height numbers while the seconds are displayed using 4-line height numerals.

3-line and 4-line large font numerals

3-line and 4-line large font numerals

Continue reading

4-Line LCD Big Numbers

Hard on the heels of the discussions around 2-line big fonts for the popular 2×16 character LCDs and set of 3-line numbers for the 4×20 character LCD, I decided to create a set of numbers that span the full 4-lines of a 4×20 display. The numbers are 20mm tall and, with the backlight, easy to read across a room. Ideal for clocks!

4-line big font numerals

4-line big font numerals

Continue reading