In the simple example here I start an IntervalTimer with 20 msec. callback. In the function called I have a 10 msec. delay. My question is does this delay eat up half of my computational time, or is the delay handled in the background. View attachment Timer_example.ino
volatile int usec_F = 10000;
IntervalTimer timerFront;
timerFront.begin(front_Servos, 20000);
void front_Servos()
{
digitalWrite(2, HIGH);
delayMicroseconds(usec_F);
digitalWrite(2, LOW);
}
void setup() {
timerFront.begin(front_Servos, 20000);
}
void loop() {
}
volatile int usec_F = 10000;
IntervalTimer timerFront;
timerFront.begin(front_Servos, 20000);
void front_Servos()
{
digitalWrite(2, HIGH);
delayMicroseconds(usec_F);
digitalWrite(2, LOW);
}
void setup() {
timerFront.begin(front_Servos, 20000);
}
void loop() {
}