arduino-audio-tools
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
audio_tools::AudioActions Class Reference

A simple class to assign Functions to Pins e.g. to implement a simple navigation control or volume control with buttons. More...

#include <AudioActions.h>

Classes

struct  Action
 

Public Types

enum  ActiveLogic : uint8_t { ActiveLow , ActiveHigh , ActiveChange , ActiveTouch }
 

Public Member Functions

void add (int pin, void(*actionOn)(bool pinStatus, int pin, void *ref), ActiveLogic activeLogic=ActiveLow, void *ref=nullptr)
 Adds an action.
 
void add (int pin, void(*actionOn)(bool pinStatus, int pin, void *ref), void(*actionOff)(bool pinStatus, int pin, void *ref), ActiveLogic activeLogicPar=ActiveLow, void *ref=nullptr)
 Adds an action.
 
void processActions ()
 Execute all actions if the corresponding pin is low To minimize the runtime: With each call we process a different pin.
 
void setDeboundDelay (int value)
 Defines the debounce delay.
 
void setEnabled (int pin, bool enabled)
 enable/disable pin actions
 
void setTouchLimit (int value)
 Defines the touch limit (Default 20)
 

Protected Member Functions

int findPin (int pin)
 
bool readValue (Action *a)
 determines the value for the action
 

Protected Attributes

struct audio_tools::AudioActions::Action actions [ACTIONS_MAX]
 
int debounceDelayValue = DEBOUNCE_DELAY
 
int maxIdx = 0
 
int touchLimit = TOUCH_LIMIT
 

Detailed Description

A simple class to assign Functions to Pins e.g. to implement a simple navigation control or volume control with buttons.


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