JeeLib
An easy interface to the port headers, the RF12 driver library, timers, low-power code, and more.
 All Classes Files Functions Variables Enumerations Macros Pages
MilliTimer Class Reference

The millisecond timer can be used for timeouts up to 60000 milliseconds. More...

#include <Ports.h>

Public Member Functions

byte poll (word ms=0)
 poll until the timer fires More...
 
word remaining () const
 Return the number of milliseconds before the timer will fire.
 
byte idle () const
 Returns true if the timer is not armed.
 
void set (word ms)
 set the one-shot timeout value More...
 

Detailed Description

The millisecond timer can be used for timeouts up to 60000 milliseconds.

Setting the timeout to zero disables the timer.

  • for periodic use, poll the timer object with "if (timer.poll(123)) ..."
  • for one-shot use, call "timer.set(123)" and poll as "if (timer.poll())"

Member Function Documentation

byte MilliTimer::poll ( word  ms = 0)

poll until the timer fires

Parameters
msPeriodic repeat rate of the time, omit for a one-shot timer.
void MilliTimer::set ( word  ms)

set the one-shot timeout value

Parameters
msTimeout value. Timer stops once the timer has fired.

The documentation for this class was generated from the following files: