Improve Button API documentation in GenericHID (#2421)

This commit is contained in:
Prateek Machiraju
2020-03-15 22:54:23 -04:00
committed by GitHub
parent 5854e284ea
commit 510936a2a0
2 changed files with 24 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -127,6 +127,9 @@ public abstract class GenericHID {
* <p>The buttons are returned in a single 16 bit value with one bit representing the state of
* each button. The appropriate button is returned as a boolean value.
*
* <p>This method returns true if the button is being held down at the time
* that this method is being called.
*
* @param button The button number to be read (starting at 1)
* @return The state of the button.
*/
@@ -138,6 +141,10 @@ public abstract class GenericHID {
* Whether the button was pressed since the last check. Button indexes begin at
* 1.
*
* <p>This method returns true if the button went from not pressed to held down
* since the last time this method was called. This is useful if you only
* want to call a function once when you press the button.
*
* @param button The button index, beginning at 1.
* @return Whether the button was pressed since the last check.
*/
@@ -149,6 +156,10 @@ public abstract class GenericHID {
* Whether the button was released since the last check. Button indexes begin at
* 1.
*
* <p>This method returns true if the button went from held down to not pressed
* since the last time this method was called. This is useful if you only
* want to call a function once when you release the button.
*
* @param button The button index, beginning at 1.
* @return Whether the button was released since the last check.
*/