mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Change Xbox LT/LB/RT/RB rumble ref in example
Missed this one in 135608c
.
This commit is contained in:
parent
db31a4d125
commit
8e78fc202e
1 changed files with 6 additions and 6 deletions
|
@ -64,12 +64,12 @@ void loop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set rumble effect
|
// Set rumble effect
|
||||||
static uint16_t oldL2Value, oldR2Value;
|
static uint16_t oldLTValue, oldRTValue;
|
||||||
if (Xbox.getButtonPress(L2) != oldL2Value || Xbox.getButtonPress(R2) != oldR2Value) {
|
if (Xbox.getButtonPress(LT) != oldLTValue || Xbox.getButtonPress(RT) != oldRTValue) {
|
||||||
oldL2Value = Xbox.getButtonPress(L2);
|
oldLTValue = Xbox.getButtonPress(LT);
|
||||||
oldR2Value = Xbox.getButtonPress(R2);
|
oldRTValue = Xbox.getButtonPress(RT);
|
||||||
uint8_t leftRumble = map(oldL2Value, 0, 1023, 0, 255); // Map the trigger values into a byte
|
uint8_t leftRumble = map(oldLTValue, 0, 1023, 0, 255); // Map the trigger values into a byte
|
||||||
uint8_t rightRumble = map(oldR2Value, 0, 1023, 0, 255);
|
uint8_t rightRumble = map(oldRTValue, 0, 1023, 0, 255);
|
||||||
if (leftRumble > 0 || rightRumble > 0)
|
if (leftRumble > 0 || rightRumble > 0)
|
||||||
Xbox.setRumbleOn(leftRumble, rightRumble, leftRumble, rightRumble);
|
Xbox.setRumbleOn(leftRumble, rightRumble, leftRumble, rightRumble);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue