One of my first tasks here at Wyolum was updating the old ClockTHREE Jr. software for Arduino 1.6.9, the newest version. I focused specifically on updating the file specified in the original tutorial for reprogramming the ClockTHREE Jr., ClockTHREE_04.ino. At first, when I tried compiling the sketch, the number of error messages that popped up frightened me. It was just a sea of blaring orange text, informing me on the multitude of errors spanning a variety of different documents. The task seemed to be very daunting, and I did not know if I would be able to complete this task. However, after I had gotten over my initial shock, i decided to be brave and actually read the error messages, rather than judge the difficulty of the task by their quantity. This act turned out to be immensely helpful, as after my analysis, I discovered that there were only 6 documents that needed to be changed, as opposed to my crazy original assumption of 20 or 25. Furthermore, there seemed to be one term that resonated throughout the error messages: “const.” With these 2 helpful facts in mind, I got to work. Below is a detailed analysis of what I did to the 6 documents:
- In the original file itself, ClockTHREE_04.ino, I included the english_v3.h file, uncommented the line that let the ClockTHREE Jr. account for Daylights Savings Time, and most importantly, changed “prog” in the line “PROGREM prog_uint32_t DST[] = {“ to a “const.”
- In the next document I changed, english_v3.h, I simply added a const after the “uint8/32_t” in the lines with WORDS[] PROGMEM, DISPLAYS[] PROGMEM, MINUTE_LEDS[] PROGMEM, and MINUTES_HACKS[] PROGMEM.
- The next file I had to change took me away from the ClockTHREE Jr. file and into the CHRONOGRAM2 file, where I had to update the english2_v1.h file. In this file, I changed “prog_char” to “const_char” in the lines with HOUR_WORDS[], HOUR_SEQ[], MINUTE_WORDS[], and MINUTE_SEQ[].
- In the files font.cpp and mem_font.cpp, I respectively changed “PROGMEM static char prog_char font8x8[] = {” to “PROGREM static const char font8x8[] = {“ and “static prog_char font8x7[] PROGMEM = {“ to “static const char font8x7[] PROGMEM = {.“
- In the final document I changed, DateStrings.cpp, I added a “const” to:
- char monthShortNames_P[] PROGMEM = “ErrJanFebMarAprMayJunJulAugSepOctNovDec”;
- char dayStr0[] PROGMEM = “Err”;
- char dayStr1[] PROGMEM = “Sunday”;
- char dayStr2[] PROGMEM = “Monday”;
- char dayStr3[] PROGMEM = “Tuesday”;
- char dayStr4[] PROGMEM = “Wednesday”;
- char dayStr5[] PROGMEM = “Thursday”;
- char dayStr6[] PROGMEM = “Friday”;
- char dayStr7[] PROGMEM = “Saturday”;
- PGM_P dayNames_P[] PROGMEM = { dayStr0,dayStr1,dayStr2,dayStr3,dayStr4,dayStr5,dayStr6,dayStr7};
- char dayShortNames_P[] PROGMEM = “ErrSunMonTueWedThrFriSat”;
- char monthStr1[] PROGMEM = “January”;
- char monthStr2[] PROGMEM = “February”;
- char monthStr3[] PROGMEM = “March”;
- char monthStr4[] PROGMEM = “April”;
- char monthStr5[] PROGMEM = “May”;
- char monthStr6[] PROGMEM = “June”;
- char monthStr7[] PROGMEM = “July”;
- char monthStr8[] PROGMEM = “August”;
- char monthStr9[] PROGMEM = “September”;
- char monthStr10[] PROGMEM = “October”;
- char monthStr11[] PROGMEM = “November”;
- char monthStr12[] PROGMEM = “December”;
- PGM_P monthNames_P[] PROGMEM =
After saving all of my changes, I compiled the code in Arduino 1.6.9, and to my utter delight, it worked!