From 2182ec9a97e427532507e02e5a8cbeec64549982 Mon Sep 17 00:00:00 2001 From: Kristian Lauszus Date: Wed, 3 Oct 2012 21:29:44 +0200 Subject: [PATCH] Added comment about difference bewteen getButtonPress and getButtonClick --- PS3USB.h | 7 +++++++ Wii.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/PS3USB.h b/PS3USB.h index 0088ccd7..f434e268 100644 --- a/PS3USB.h +++ b/PS3USB.h @@ -68,8 +68,15 @@ public: void setMoveBdaddr(uint8_t* BDADDR); /* PS3 Controller Commands */ + /* + getButtonPress will return true as long as the button is held down + While getButtonClick will only return it once + So you instance if you need to increase a variable once you would use getButtonClick, + but if you need to drive a robot forward you would use getButtonPress + */ bool getButtonPress(Button b); bool getButtonClick(Button b); + uint8_t getAnalogButton(AnalogButton a); uint8_t getAnalogHat(AnalogHat a); uint16_t getSensor(Sensor a); diff --git a/Wii.h b/Wii.h index 048143cf..bed254f8 100644 --- a/Wii.h +++ b/Wii.h @@ -105,8 +105,15 @@ public: virtual void Reset(); // Use this to reset the service virtual void disconnect(); // Use this void to disconnect any of the controllers + /* + getButtonPress will return true as long as the button is held down + While getButtonClick will only return it once + So you instance if you need to increase a variable once you would use getButtonClick, + but if you need to drive a robot forward you would use getButtonPress + */ bool getButtonPress(Button b); // This will read true as long as the button is held down bool getButtonClick(Button b); // This will only be true when the button is clicked the first time + uint8_t getAnalogHat(AnalogHat a); // Used to read the joystick of the Nunchuck double getPitch() { return pitch; }; // Fusioned angle using a complimentary filter if the Motion Plus is connected