#include <hurdygurdy.h>
◆ HurdyGurdy()
HurdyGurdy::HurdyGurdy |
( |
const int |
pin_arr[], |
|
|
int |
key_size |
|
) |
| |
Constructor. HurdyGurdy abstracts the keybox and keybox buttons.
- Parameters
-
pin_arr | Array of keybox pins, ordered from lowest to highest starting with index 1 |
key_size | Number of keybox pins, the len of pin_arr[] - 1 |
◆ 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.
◆ keybox
The documentation for this class was generated from the following files: