Just got my T4s this week and I'm putting th T4 through some basic tests. I wrote a very basic IntervalTime sketch using 4 channels of the IntervalTimer and discovered that it will only handle two channels. The other two (any combination of two) are ignored.
Is this a known problem, or did I blow it somewhere?
Here is the sketch:
Update: It should also be noted that the last two instances do return false indicating resources are not available, but I don't understand why this may be happening in such a basic demonstration.
Is this a known problem, or did I blow it somewhere?
Here is the sketch:
Update: It should also be noted that the last two instances do return false indicating resources are not available, but I don't understand why this may be happening in such a basic demonstration.
Code:
IntervalTimer timer_led1;
IntervalTimer timer_led2;
IntervalTimer timer_led3;
IntervalTimer timer_led4;
const uint8_t led1 = 1;
const uint8_t led2 = 2;
const uint8_t led3 = 3;
const uint8_t led4 = 4;
void toggle( const uint8_t pin ) { digitalWrite( pin, !digitalRead(pin) ); }
void led1_isr() { toggle( led1 ); }
void led2_isr() { toggle( led2 ); }
void led3_isr() { toggle( led3 ); }
void led4_isr() { toggle( led4 ); }
//--------------------------------------------------------------------------------------//
void setup()
{
pinMode( led1, OUTPUT );
pinMode( led2, OUTPUT );
pinMode( led3, OUTPUT );
pinMode( led4, OUTPUT );
timer_led1.begin( led1_isr, 100000 );
timer_led2.begin( led2_isr, 250000 );
timer_led3.begin( led3_isr, 500000 );
timer_led4.begin( led4_isr, 1000000 );
}
void loop() {}
Last edited: