Mutila: Mouse's Utilities for Arduino
Oft-used utilities: debouncing buttons, averaging samples, and so on.
Public Member Functions | Public Attributes | List of all members
ModeManager Class Reference

#include <ModeManager.h>

Public Member Functions

void begin (Mode *initialMode)
 
void update ()
 
void switchMode (Mode *newMode, bool force=false)
 
bool modeFinished ()
 

Public Attributes

ModecurrentMode
 

Detailed Description

ModeManager class for switching between mutually exclusive Modes.

Definition at line 7 of file ModeManager.h.

Member Function Documentation

◆ begin()

void ModeManager::begin ( Mode initialMode)

Initialization.

Typically called from setup().

Parameters
initialModethe mode to start in.

Definition at line 9 of file ModeManager.cpp.

Here is the call graph for this function:

◆ modeFinished()

bool ModeManager::modeFinished ( )

Check to see if the current mode is finished.

Returns
true if the current Mode is finished, else false.

Definition at line 33 of file ModeManager.cpp.

Here is the call graph for this function:

◆ switchMode()

void ModeManager::switchMode ( Mode newMode,
bool  force = false 
)

Change Mode.

Call to end the current Mode and start the new Mode.

Parameters
newModethe new mode to switch to.
forcecalling stop in current mode and start in new mode, even if they are the same.

Definition at line 22 of file ModeManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update()

void ModeManager::update ( )

Allocate timeslice.

Called frequently to update the current mode, typically from loop().

Definition at line 15 of file ModeManager.cpp.

Here is the call graph for this function:

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