From c2974d3d21b00403e39e05c36358678a05ce7b8d Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Sun, 8 Nov 2015 23:24:05 -0500 Subject: [PATCH] Add some debugging statements. --- Joystick.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Joystick.cpp b/Joystick.cpp index 0a11196..9f0c813 100644 --- a/Joystick.cpp +++ b/Joystick.cpp @@ -42,11 +42,23 @@ void Joystick::AddButton(uint8_t pin, ButtonType type, bool pullup) { if (type == BUTTON_PULSED || type == BUTTON_PULSED_DOUBLE_ACTION) { _have_pulsed_button = true; } + + if (_debug) { + Serial.print("Debug: added button of type "); + Serial.print(type); + Serial.print(" on digital pin "); + Serial.println(pin); + } } void Joystick::AddAxis(uint8_t pin) { _axes[_num_axes] = pin; _num_axes++; + + if (_debug) { + Serial.print("Debug: added axis on analog pin "); + Serial.println(pin); + } } void Joystick::Update() {