Control Surface  1.1.1
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 <AH/Timing/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...
 
unsigned long getInterval () const
 Get the interval of the timer. More...
 
void setInterval (unsigned long interval)
 Set the interval of the timer. More...
 

Private Attributes

unsigned long interval
 
unsigned long previous = 0
 

Detailed Description

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

A class for easily managing timed events.

A wrapper for "Blink Without Delay".

Template Parameters
timeThe time function to use.

Definition at line 28 of file MillisMicrosTimer.hpp.

Constructor & Destructor Documentation

◆ Timer()

Timer ( unsigned long  interval)
inline

Constructor.

Parameters
intervalThe interval between two events.

Definition at line 35 of file MillisMicrosTimer.hpp.

Member Function Documentation

◆ begin()

void begin ( )
inline

Initialize the timer.

Definition at line 41 of file MillisMicrosTimer.hpp.

◆ operator bool()

operator bool ( )
inlineexplicit

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

Definition at line 43 of file MillisMicrosTimer.hpp.

◆ getInterval()

unsigned long getInterval ( ) const
inline

Get the interval of the timer.

Definition at line 53 of file MillisMicrosTimer.hpp.

◆ setInterval()

void setInterval ( unsigned long  interval)
inline

Set the interval of the timer.

Definition at line 55 of file MillisMicrosTimer.hpp.

Member Data Documentation

◆ interval

unsigned long interval
private

Definition at line 58 of file MillisMicrosTimer.hpp.

◆ previous

unsigned long previous = 0
private

Definition at line 59 of file MillisMicrosTimer.hpp.


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