ArduinoXInput
ArduinoXInput copied to clipboard
Rumble/ Forcefeedack
No Rumble data or forcefeedback data is being received by the callback function. Is anyone facing a similar issue? Using Arduino Micro.
xbox.setReceiveCallback(rumbleCallback);
Is this line of code enough to receive callback data. I mean in my pc the controller is working fine but there is no forcefeedback feature being shown. I am assuming more initialization codes need to be written in setup() to actually innitiate rumble feature. Also Is there any necessity of a receive() function in void loop() to look for async callbackks or rumble data.?
#The callback function.
int rumble;
void rumbleCallback(uint8_t packetType) {
// If we have an LED packet (0x01), do nothing
if (packetType == (uint8_t) XInputReceiveType::LEDs) {
return;
}
// If we have a rumble packet (0x00), see our rumble data on the LED
else if (packetType == (uint8_t) XInputReceiveType::Rumble) {
uint8_t rumbleValue = xbox.getRumbleRight();
rumble = rumbleValue;
}
}