Skip to content

Commit 140a6e9

Browse files
committed
Fix right trigger for SimulateAll example
This broke after adding range rescaling. This bitwise operator was acting on the argument type rather than the variable type, so it wasn't inverting properly (and I was being a bit too clever for my own good). This works fine.
1 parent 3e1153f commit 140a6e9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

examples/SimulateAll/SimulateAll.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ void loop() {
108108
// Triggers
109109
if (t - triggerTimeLast >= TriggerDuration) { // If enough time has passed, update the triggers
110110
XInput.setTrigger(TRIGGER_LEFT, triggerVal);
111-
XInput.setTrigger(TRIGGER_RIGHT, ~triggerVal); // Inverse
111+
XInput.setTrigger(TRIGGER_RIGHT, TriggerMax - triggerVal); // Inverse
112112

113113
// Increment trigger value based on direction
114114
if (triggerDirection == 0) { triggerVal++; }

0 commit comments

Comments
 (0)