Noiasca Tool Kit
Several helper functions and classes to make life with Arduino easier
Public Member Functions | List of all members
MiniTimer Class Reference

a very simple timer More...

#include <Noiasca_timer.h>

Public Member Functions

uint16_t hasTriggered ()
 indicate if timer has been triggered More...
 
bool hasEnded ()
 indicate if timer has been ended More...
 
void start ()
 start timer More...
 
void stop ()
 stop timer More...
 
byte getState ()
 get the state of the timer More...
 
void setLimit (uint32_t limit)
 get the limit of the timer More...
 
void setIteration (uint32_t iteration)
 set the iteration More...
 
uint32_t getIteration ()
 get the iteration More...
 
void update (uint32_t currentMillis=millis())
 run method More...
 

Detailed Description

a very simple timer

I just wanted a very simple minimalistic timer. But I propose to use the LittleTimer instead. The main difference is that this timere has no callback functions

See also
LittleTimer

Member Function Documentation

◆ hasTriggered()

uint16_t MiniTimer::hasTriggered ( )
inline

indicate if timer has been triggered

Returns
> 0 if interval time is passed since last call. Returns the number of "missed" intervals.

◆ hasEnded()

bool MiniTimer::hasEnded ( )
inline

indicate if timer has been ended

Returns
true if interval time is over.

◆ start()

void MiniTimer::start ( )
inline

start timer

starts the timer.

◆ stop()

void MiniTimer::stop ( )
inline

stop timer

stops the timer.

◆ getState()

byte MiniTimer::getState ( )
inline

get the state of the timer

Returns
the current state of the timer

◆ setLimit()

void MiniTimer::setLimit ( uint32_t  limit)
inline

get the limit of the timer

Parameters
limithow often should the timer fire

◆ setIteration()

void MiniTimer::setIteration ( uint32_t  iteration)
inline

set the iteration

Modify the counter of iterations.

Parameters
iterationhow often has the timer fired

◆ getIteration()

uint32_t MiniTimer::getIteration ( )
inline

get the iteration

Returns the current number of ioterations.

Returns
interations of how often the timer has fired.

◆ update()

void MiniTimer::update ( uint32_t  currentMillis = millis())
inline

run method

call this function in your loop()