Add BUTTON_LATCHED_MOMENTARY type, to allow a pushbutton to mimic the behavior of a toggle switch.
This commit is contained in:
22
examples/type_test/type_test.ino
Normal file
22
examples/type_test/type_test.ino
Normal file
@ -0,0 +1,22 @@
|
||||
// An example sketch using the joystick library.
|
||||
// In this example, we have 3 toggle switches and 2 momentary pushbuttons.
|
||||
// Each button is configured in a different one of the available behaviors.
|
||||
|
||||
#include <Bounce2.h>
|
||||
#include <Joystick.h>
|
||||
|
||||
bool debug = false;
|
||||
Joystick joystick(debug);
|
||||
|
||||
void setup() {
|
||||
joystick.AddButton(9, BUTTON_PASSTHRU);
|
||||
joystick.AddButton(10, BUTTON_LATCHED_MOMENTARY);
|
||||
joystick.AddButton(11, BUTTON_PULSED);
|
||||
joystick.AddButton(12, BUTTON_PULSED_DOUBLE_ACTION);
|
||||
joystick.AddButton(13, BUTTON_PULSED_DOUBLE_ACTION_SPLIT);
|
||||
joystick.Init();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
joystick.Update();
|
||||
}
|
Reference in New Issue
Block a user