Skip to content
thomasfredericks edited this page Dec 22, 2013 · 2 revisions

METRO

Metro library for Arduino or Wiring that facilitates the implementation of recurring timed events by Thomas Ouellet Fredericks with contributions from: Paul Bouchier and Benjamin.soelberg

DOWNLOAD

Download the latest version here : https://github.com/thomasfredericks/Metro-Arduino-Wiring/archive/master.zip

INSTALLATION

Put the Metro folder in your Arduino or Wiring "libraries".

METHODS

Metro()

Instantiates a Metro object with a default interval of 1000 milliseconds.

Metro(unsigned long interval)

Instantiates a Metro object with a set interval in milliseconds.

byte check()

Because Metro does not use interrupts, you have to "check" the Metro regularly (as often as possible). check() returns true if the interval has lapsed. Returns false if not.

void interval(unsigned long interval)

Changes the interval in milliseconds.

void reset()

Restarts/resets the Metro. Often a good idea if you change the interval.