What is a timed reminder and why can they be useful?
Timed reminders are used widely every day by many, many people. When you create a diary entry on your smart phone or pc to alert you (remind you) at a specified point in time, then this is an example of a timed reminder. How useful would such a capability be in designing your ARDUINO applications?
With timed reminders it is possible to design solutions that do ‘things’ at given points in time but, just as importantly, do ‘other things’ that are not at all associated with timed reminders.
The User Guide describes and promotes a framework that provides all of the functionality for developing ARDUINO solutions based on this concept. The method lends itself to thinking about solutions to problems in a different way and is particularly suited to designing multi-tasking solutions without the use of the delay() or micros/millis(). Indeed, the use of the delay function, inparticular, should be avoided if at all possible as lengthy periods of‘dead-time’ will affect the timer interrupt scanning of the timed reminder list.
Timed reminders can therefore provide a new way to think about solutions, ways to craft code and its decision flows. For example, solutions that are:
- highly configurable
- often simpler to design
- coding flexible
- less constraining
- able to deal with complex logic
This User Guide presents an overview of the framework for ARDUINO and compatible microcontroller application developments. The framework has been developed using an Elegoo MEGA 2560 microcontroller.The Requirements (Objectives)
In designing this framework a number of objectives were set, these being to arrive at an outcome that would:
- allow a number of timed reminders to be defined and active at any time
- provide a range of differing time reminder types that provide the end user with options for flexibility in application design
- utilise the microcontroller interrupt driven clock for its timing source
- provide a straight forward end user means to
- - define a timed reminder
- - remove a timed reminder
- allow end users to ‘attach’ data to timed reminders that can subsequently be used within the application design to control flow and inform decision branching
- allow control processes to operate separate and independently from the scanning and generation of timed reminder alerts
The framework is designed around two concepts:
1. a reminder list, which is used to hold current timed reminder requests, and
2. a reminder alert queue, which is used to hold reminder alerts as they are raised (elapse), ready for processing by main line code.
The reminder list is maintained as a simple list of reminder entries. However, the reminder alert queue (RQ) is managed as a true queue on a first in, first out basis (FIFO). This ensures that reminder alerts are dealt with in the order in which they occur (elapse).
The reminder queue is supplied from a free chain of blocks that are allocated, on demand, following the elapse of a reminder.
End user code can be inserted into the framework easily which can incorporate a range of useful functions to handle reminder alerts, create new reminders, delete old reminders, etc. The framework is initially sized for 10 concurrently active timed reminder definitions, but this is end user configurable.
The User Guide ("ARDUINO Timed Reminders, vx,xx.pdf") provides full instructions, details and examples in the use of the framework. It can be fond on the GitHub site (follow the code link).
The GitHub site also provides full down load instructions (see "DOWNLOAD_INSTRUCTIONS").