Skip to content

Commit d2b0d5a

Browse files
committed
Update examples with autosend
Removes 'send' calls from simple examples, and disables autosend for the more complex examples.
1 parent aabcd95 commit d2b0d5a

5 files changed

Lines changed: 5 additions & 4 deletions

File tree

examples/Blink/Blink.ino

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ void setup() {
3636

3737
void loop() {
3838
XInput.press(BUTTON_A);
39-
XInput.send();
4039
delay(1000);
4140

4241
XInput.release(BUTTON_A);
43-
XInput.send();
4442
delay(1000);
4543
}

examples/GamepadPins/GamepadPins.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ void setup() {
116116

117117
// Set joystick range to the ADC max
118118
XInput.setJoystickRange(0, ADC_Max);
119+
120+
XInput.setAutoSend(false); // Wait for all controls before sending
119121
}
120122

121123
void loop() {

examples/ReceiveCallback/ReceiveCallback.ino

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ void loop() {
5555
else {
5656
XInput.release(TRIGGER_RIGHT);
5757
}
58-
59-
XInput.send();
6058
}
6159

6260
void rumbleCallback(uint8_t packetType) {

examples/SimulateAll/SimulateAll.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ double angle = 0.0;
7474

7575
void setup() {
7676
pinMode(SafetyPin, INPUT_PULLUP);
77+
XInput.setAutoSend(false); // Wait for all controls before sending
7778
}
7879

7980
void loop() {

examples/WiiClassicController/WiiClassicController.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ void setup() {
4141
XInput.setRange(JOY_LEFT, 8, 56);
4242
XInput.setRange(JOY_RIGHT, 4, 28);
4343

44+
XInput.setAutoSend(false); // Wait for all controls before sending
45+
4446
while (!classic.connect()) {
4547
delay(1000); // Controller not connected
4648
}

0 commit comments

Comments
 (0)