Programming the Arduino
Step 1: Install the MatesController library using Arduino’s Library Manager.
Step 2: Install the RTClib library using Arduino’s Library Manager.
Step 3: Include MatesController.h and RTClib.h to your project.
Step 4: Create a MatesController instance named mates and an RTC_DS3231 instance named rtc.
This will initialize the MatesController instance to the default reset pin 4 using a LOW pulse.
Step 5: (Optional) Create a function for toggling the built-in LED of the Arduino board. This can be used for debugging or showing errors if the Serial monitor can’t be used.
Step 6: (Optional) At the beginning of the setup function, set the built-in LED pin to OUTPUT and set it to LOW.
Step 7: To start using the MatesController instance, use the begin function
This will initialize the Serial UART at the default baudrate of 9600
Step 8: (Optional) The begin function can be enclosed in an if condition to handle initialization errors.
Step 9: To print the day of week, an array of strings needs to be prepared.
Step 10: In the loop function, the time and day values are read from the RTC and sent to TIMI as necessary.
As shown, the RTC module is read every loop with the day of week and time values. The widgets are then updated accordingly.