change Metro interval

Hi!
I´m using Metro lybrary to set an interval on my program.

At a specific time i need to change its duration interval but i can´t figure out how

// declare the interval with a duration variable
int duration = 250;
#include <Metro.h>
Metro checkDistance_timer = Metro (duration);

void setup() {

}


void loop() {
  if (checkDistance_timer.check() == 1) { // check if the metro has passed it's interval .
    doSomething();
  }
}


// unit here everything´s fine, the function doSomething(); is running under 250

// then under a condition i need to change the interval duration and i´m using this next code
// but with no success

duration = 9000;
checkDistance_timer.reset();

can someone help me on this?

thnx :slight_smile:

ok nevermind.. it´s solved :D

http://www.arduino.cc/playground/Code/Metro

To change the interval to 1 second use interval() like this: led_metro.interval(1000)

To restart/reset the Metro, use reset(): led_metro.reset()