Avoid using delay() to control tasks durations inside the loop() since it is a blocking function which prevents your program from doing anything else in parallel (including serial communication with HITIPanel). Such function disturbs control, monitoring, and data acquisition. As a replacement, use the Timing library to control tasks durations.
The Timing library is a non-blocking library which lets you run several tasks in parallel and control their durations. It is ideal for multitasking applications.
A HITI Timer lets you control the duration of a task and trigger events accordingly.
To use HITI Timers (included in the Base library) :
A HITI MultiTimer allows you to control several consecutive delayed tasks.
To use HITI MultiTimers :