From cb2ff426b355a346b9da8fa97cf22bba0dca5e9e Mon Sep 17 00:00:00 2001 From: Luis Saavedra Date: Sun, 9 Jun 2013 16:40:46 -0400 Subject: [PATCH] Basic example dont work if IntervalTimers are defined in setup... --- examples/Basic/Basic.ino | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/Basic/Basic.ino b/examples/Basic/Basic.ino index 410c463..821435e 100644 --- a/examples/Basic/Basic.ino +++ b/examples/Basic/Basic.ino @@ -1,5 +1,7 @@ #include "IntervalTimer.h" +IntervalTimer timer0, timer1, timer2; + volatile bool printNow = true; volatile uint32_t timerCounter0; volatile uint32_t timerCounter1; @@ -35,9 +37,6 @@ void timerCallback2() { void setup() { Serial.begin(true); delay(500); - IntervalTimer timer0; - IntervalTimer timer1; - IntervalTimer timer2; timer0.begin(timerCallback0, 500); // 2 kHz timer1.begin(timerCallback1, 5000000); // 5 seconds timer2.begin(timerCallback2, 1000000); // 1 second