From 9234060532fcb0d108c3103be0cc73437c38b78f Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Sat, 14 Nov 2015 20:00:41 -0500 Subject: [PATCH] Add comments to example code. --- .../complex_switch_panel/complex_switch_panel.ino | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/complex_switch_panel/complex_switch_panel.ino b/examples/complex_switch_panel/complex_switch_panel.ino index 27517e2..e931bfb 100644 --- a/examples/complex_switch_panel/complex_switch_panel.ino +++ b/examples/complex_switch_panel/complex_switch_panel.ino @@ -12,11 +12,18 @@ void setup() { digitalWrite(13, LOW); joystick.Init(); + // 3 toggle switches that emit a press every time they are toggled. + // (in either direction) joystick.AddButton(2, BUTTON_PULSED_DOUBLE_ACTION); joystick.AddButton(3, BUTTON_PULSED_DOUBLE_ACTION); joystick.AddButton(4, BUTTON_PULSED_DOUBLE_ACTION); - joystick.AddButton(5, BUTTON_LATCHED); - joystick.AddButton(6, BUTTON_PULSED); + + // This button will stay 'held down' as long as the switch is on. + joystick.AddButton(6, BUTTON_LATCHED); + + // This button will emit a short press every time it is pushed, but + // only one per push. + joystick.AddButton(8, BUTTON_PULSED); } void loop () {