This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
MIDI Control Surface library for Arduino
Public Member Functions | Private Attributes | List of all members
Timer< time > Class Template Reference

A class for easily managing timed events. More...

#include <MillisMicrosTimer.hpp>

Collaboration diagram for Timer< time >:

Public Member Functions

 Timer (unsigned long interval)
 Constructor. More...
 
void begin ()
 Initialize the timer. More...
 
 operator bool ()
 Update the timer and return true if the event should fire. More...
 

Private Attributes

const unsigned long interval
 
unsigned long previous = 0
 

Detailed Description

template<timefunction time = micros>
class Timer< time >

A class for easily managing timed events.

A wrapper for "Blink Without Delay".

Template Parameters
timeThe time function to use.
Examples
FilteredAnalog.ino.

Definition at line 22 of file MillisMicrosTimer.hpp.

Constructor & Destructor Documentation

◆ Timer()

template<timefunction time = micros>
Timer< time >::Timer ( unsigned long  interval)
inline

Constructor.

Parameters
intervalThe interval between two events.

Definition at line 29 of file MillisMicrosTimer.hpp.

Member Function Documentation

◆ begin()

template<timefunction time = micros>
void Timer< time >::begin ( )
inline

Initialize the timer.

Definition at line 35 of file MillisMicrosTimer.hpp.

◆ operator bool()

template<timefunction time = micros>
Timer< time >::operator bool ( )
inlineexplicit

Update the timer and return true if the event should fire.

Definition at line 37 of file MillisMicrosTimer.hpp.

Member Data Documentation

◆ interval

template<timefunction time = micros>
const unsigned long Timer< time >::interval
private

Definition at line 47 of file MillisMicrosTimer.hpp.

◆ previous

template<timefunction time = micros>
unsigned long Timer< time >::previous = 0
private

Definition at line 48 of file MillisMicrosTimer.hpp.


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