Digigurdy-baz
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
HurdyGurdy Class Reference

#include <hurdygurdy.h>

Public Member Functions

 HurdyGurdy (const int pin_arr[], int key_size)
 Constructor. HurdyGurdy abstracts the keybox and keybox buttons. More...
 
int getMaxOffset ()
 Updates all keybox objects, returns the highest key being pressed on the keybox. More...
 
bool higherKeyPressed ()
 Returns whether or not a higher key is being pressed this cycle. More...
 
bool lowerKeyPressed ()
 Retruns whether or not a lower key is being pressed this cycle. More...
 

Public Attributes

KeyboxButtonkeybox [num_keys]
 

Constructor & Destructor Documentation

◆ HurdyGurdy()

HurdyGurdy::HurdyGurdy ( const int  pin_arr[],
int  key_size 
)

Constructor. HurdyGurdy abstracts the keybox and keybox buttons.

Parameters
pin_arrArray of keybox pins, ordered from lowest to highest starting with index 1
key_sizeNumber of keybox pins, the len of pin_arr[] - 1

Member Function Documentation

◆ getMaxOffset()

int HurdyGurdy::getMaxOffset ( )

Updates all keybox objects, returns the highest key being pressed on the keybox.

Returns
the index of the highest key being pressed
Note
This is meant to be run every loop() cycle.

◆ higherKeyPressed()

bool HurdyGurdy::higherKeyPressed ( )

Returns whether or not a higher key is being pressed this cycle.

Returns
True if the current max_offset is greater than the max_offset last cycle, false otherwise.
Note
This method is for determing if a keyclick sound needs to be made.

◆ lowerKeyPressed()

bool HurdyGurdy::lowerKeyPressed ( )

Retruns whether or not a lower key is being pressed this cycle.

Returns
True if the current max_offset is strictly less than the offset last cycle. False otherwise.

Member Data Documentation

◆ keybox

KeyboxButton* HurdyGurdy::keybox[num_keys]

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