SimpleTimer max number

Hi all,

I have 12 functions which I need to get called through SimpleTimer.
I know that the max number of a simpleTimer is 10, but thought that if I define an additional timer I will be able to add 10 more intervals. However, it looks like adding a new timer (e.g. timer2) doesn’t work as I am still getting 10 timers to work while the other 2 timers are being ignored. I know I might be able to combine some of the functions, but prefer to keep them separate if possible. Below is the relevant part of the code:

  SimpleTimer timer; 
  SimpleTimer timer1;

  and in void setup() I have the following:

  timer.setInterval(5000L, sendTempToGraphBlynk);
  timer.setInterval(7500L, sendPHToGraphBlynk);
  timer.setInterval(2000L, updatePinState);
  timer.setInterval(3000L, temperatureConroller);
  timer.setInterval(1500L, temperatureConrollerStatusUpdate);
  timer.setInterval(8500L, pHtempCompensation);
  timer.setInterval(6300L, tempAlarm);
  timer.setInterval(4300L, pHAlarm);
  timer.setInterval(86400000L, stabilityReport);
  timer.setInterval(10000L, AutoTopOff);
  timer1.setInterval(2700L, floodDetector);
  timer1.setInterval(5200L, floodPrevention);

do you have timer.run() and timer1.run() in loop()?

1 Like

I had timer.run() in the loop, but not timer1.run() so just added that. Thought the timer.run() runs all the timers (which obviously doesn’t make sense). It’s fixed now. Thanks so much for continued help.

1 Like