Hello to all,
in this program, there is a LED that is controlled by the activity of a PIR sensor, and a proximity sensor that checks the distance every 50ms. All three activities (LED, PIR sensor and proximity) are timed through the Ticker library timer.
The problem is this. The PIR and the sonar are scheduled correctly (respectively every 1s and every 50ms) while the function of the LED that performs the crossfade is scheduled every 1 ms.
Before including the LED and sonar functions in two libraries called PIRclass and MaxSonar, there was no problem with timing while now the function of the LED seems to be recalled every 2ms instead of every 1ms.
The management of the LED has, therefore, become slower.
Is there anyone who kindly knows how to tell me what the problem is?
Thanks
CLASSES AND PROGRAM ARE ATTACHED
MaxSonar.zip (3.05 KB)
PIRclass.zip (3.04 KB)
RandomTimer.zip (2.64 KB)
op.2_client2.zip (4.74 KB)