mini RTOS [sic]

Allowing the user to create his own callbacks is easy and probably not much more complicated for a newbie to use (it would look similar to the way attachInterrupt works). Only uses two more bytes per instance so nothing to worry about there.

Creating instances of alarms (or whatever they will be called) at runtime to minimize RAM usage to the minimum needed has also been implemented, I started out with a version of the library that allows the user to create instances of the timers he needs so memory is only consumed when needed, but it seemed a less friendly to newbies then the simpler version posted earlier.

Here is a fragment from one of my test sketches that creates three instances

AlarmClass Timer1;  
AlarmClass Timer2;
AlarmClass Timer3;

void setup(){
  // you can register time of day Alarms at any time but really shouldn't enable them until the internal clock is set

   if( dtAlarms.registerTimer( &Timer1 ) ) {        
     Timer1.value = DateTime.now() + 11;   // fire at the time of day 11 seconds from now
     Timer1.Mode.isTimeOfDay = true; // the value given above is a time of day
     Timer1.onTickHandler = &OnTimer1Tick;
     Timer1.enable();  
  }
   if( dtAlarms.registerTimer( &Timer2 ) ) {        
     Timer2.value = AlarmHMS(12,30,0)    // this is 30 minutes after 12 noon
     Timer2.onTickHandler = &OnTimer2Tick;
     Timer2.Mode.isTimeOfDay = true;
     Timer2.enable();  
  }
   if( dtAlarms.registerTimer( &Timer3 ) ) {        
     Timer3.Mode.isTimeOfDay = false; // the timer value is treated as a delay in seconds, not absolute time 
     Timer3.value =  13;   // delay in seconds from the time this alarm is enabled
     Timer3.onTickHandler = &OnTimer1Tick;
     Timer3.enable();  
  }

}

void OnTimer1Tick(void *Sender){

  if( Sender ==  &Timer1) 
      Serial.print("Timer1 event: ");            
   else  if( Sender ==  &Timer3) 
      Serial.print("Timer3 event: ");      
  timeDisplay();     
}

void OnTimer2Tick(void *Sender){
    Serial.print("Timer2 event: ");   
}