[API] Driver Buttons - Thomas-Broussard/hackberry-enableFrance GitHub Wiki
class Hackberry_buttons
TODO : A6 and A7 are analog inputs. Can't use DigitalRead function on them --> replace them by GPIO ?
Summary
| Members | Descriptions | 
|---|---|
| public  Hackberry_buttons() | Constructor of the Buttons driver | 
| public void init(unsigned char pinCalib,unsigned char pinExtra,unsigned char pinThumb,unsigned char pinLock) | Initialize the Buttons Driver | 
| public bool isPressed(unsigned char index) | Get the current state of the button | 
| public bool isPressedFor(unsigned char index,unsigned long delay_ms) | Check if the button is pressed since the programmed delay | 
Members
public  Hackberry_buttons()
Constructor of the Buttons driver
public void init(unsigned char pinCalib,unsigned char pinExtra,unsigned char pinThumb,unsigned char pinLock)
Initialize the Buttons Driver
Parameters
- 
pinCalibdigital input - pin of the Calibration button (located at the top left of the hand)
- 
pinExtradigital input - pin of the Extra button (located at the center left of the hand)
- 
pinThumbdigital input - pin of the Thumb button (located at the bottom left of the hand)
- 
pinLockdigital input - pin of the Lock button (located at the right of the hand)
public bool isPressed(unsigned char index)
Get the current state of the button
Returns
true : button pressed / false : button released
public bool isPressedFor(unsigned char index,unsigned long delay_ms)
Check if the button is pressed since the programmed delay
Parameters
- delay_msprogrammed delay (in milliseconds)
Returns
true : button pressed / false : button released