Programming: ESP8266

Check out my other articles / projects:


ESP8266 / OLED Calendar

An ESP8266 / OLED display project that renders a calendar. Due to the small real estate available, the calendar provides configuration options that affect how the calendar is displayed (see examples below). The code uses the default 10pt font that comes with the OLED library but other fonts can be substituted but may result in the code needing some 'rejigging' - the line and character spacing are all defined at the start of the program.

  

Visit my GitHub repository to view the project and retrieve the latest code, notify me of errors and so forth.


Background

The inspiration for this project came from rydepier's Arduino-and-OLED-Calendar project which was targeted at the Arduino and used a different library to drive the OLED. While rewriting it for the ESP8266, I used none of the original code.

This project relies on two separate GitHub projects :

Δ Top

In Operation

The calendar provides a couple of configuration parameters that control its visual appearance and allow it to utilise the small real estate of the OLED effectively. Namely these are:

001
002
#define CAL_SHOW_6_ROWS_OF_DAYS                     false
#define CAL_SHOW_MONTH_YEAR                         false 


CAL_SHOW_MONTH_YEAR = false,
CAL_SHOW_6_ROWS_OF_DAYS = true:
Note that the calendar takes up six lines in this example and line spacing is tight at 9 pixels between rows. Where a month renders in five rows, the line spacing will be increased to improve the readability (11 pixels between lines)..

   

CAL_SHOW_MONTH_YEAR = false,
CAL_SHOW_6_ROWS_OF_DAYS = false:
Note that the line spacing is greater than the previous examples (11 pixels between rows) but the 31 is rendered on the first line. Most months will render in five rows (or even four if it is February in a non-leap year and the first day of the month is a Monday!).


CAL_SHOW_MONTH_YEAR = true:
When rendering the month / year heading, the date must be displayed in 6 rows (as if CAL_SHOW_6_ROWS_OF_DAYS set to false). Due to real estate restrictions, the line spacing is kept tight (9 pixels).

       
Δ Top

Comments?

 Anything to say?
Name :
Email :
Comments :
Confirmation: