Added comment about difference bewteen getButtonPress and getButtonClick

This commit is contained in:
Kristian Lauszus 2012-10-03 21:29:44 +02:00
parent c55c77fa03
commit 2182ec9a97
2 changed files with 14 additions and 0 deletions

View file

@ -68,8 +68,15 @@ public:
void setMoveBdaddr(uint8_t* BDADDR); void setMoveBdaddr(uint8_t* BDADDR);
/* PS3 Controller Commands */ /* 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 getButtonPress(Button b);
bool getButtonClick(Button b); bool getButtonClick(Button b);
uint8_t getAnalogButton(AnalogButton a); uint8_t getAnalogButton(AnalogButton a);
uint8_t getAnalogHat(AnalogHat a); uint8_t getAnalogHat(AnalogHat a);
uint16_t getSensor(Sensor a); uint16_t getSensor(Sensor a);

7
Wii.h
View file

@ -105,8 +105,15 @@ public:
virtual void Reset(); // Use this to reset the service virtual void Reset(); // Use this to reset the service
virtual void disconnect(); // Use this void to disconnect any of the controllers 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 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 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 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 double getPitch() { return pitch; }; // Fusioned angle using a complimentary filter if the Motion Plus is connected