mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
Merge "Check and coerce rumble inputs to range of 0 - 1."
This commit is contained in:
@@ -419,6 +419,10 @@ public class Joystick extends GenericHID {
|
||||
* @param value The normalized value (0 to 1) to set the rumble to
|
||||
*/
|
||||
public void setRumble(RumbleType type, float value) {
|
||||
if (value < 0)
|
||||
value = 0;
|
||||
else if (value > 1)
|
||||
value = 1;
|
||||
if (type.value == RumbleType.kLeftRumble_val)
|
||||
m_leftRumble = (short)(value*65535);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user