WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation

buttonsRaw

Return the status of all 16 buttons.
The returned value has one bit per button. The bit is set if that button has been pressed.
Syntax
SonyPS2. buttonsRaw()
Where SonyPS2 is the name you have given to the device in Project Designer.
Parameters
None
Returns
PS2_BUTTONS
Example
This function is useful if you want to do a 'Press or release any button to continue' function ie
// Read and save the current button state
ps2.read();
PS2_BUTTONS current = ps2.buttonsRaw();
do{
    // Read the buttons again
    ps2.read();
} while (ps2.buttonsRaw() == current);
You can also 'OR' together various buttons. So to test if the SELECT and START buttons have both been pressed:-
#define COMBO (PS2_BTN_SELECT | PS2_BTN_START)
ps2.read();
if( (ps2.buttonsRaw() & COMBO) == COMBO){
    // Both pressed
}

 

 

Valid XHTML 1.0 Transitional