[API] Driver Buttons - Thomas-Broussard/hackberry-enableFrance GitHub Wiki
Hackberry_buttons
class 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
-
pinCalib
digital input - pin of the Calibration button (located at the top left of the hand) -
pinExtra
digital input - pin of the Extra button (located at the center left of the hand) -
pinThumb
digital input - pin of the Thumb button (located at the bottom left of the hand) -
pinLock
digital 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_ms
programmed delay (in milliseconds)
Returns
true : button pressed / false : button released