Adapt various input devices to various output devices.
https://github.com/OpenRetroPad/OpenRetroPad
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
724 B
29 lines
724 B
|
|
#include "Arduino.h" |
|
|
|
#include "gamepad/Gamepad.h" |
|
|
|
GAMEPAD_CLASS gamepad; |
|
|
|
uint8_t c = 0; |
|
|
|
void setup() { |
|
Serial.begin(115200); |
|
Serial.println("Starting debug work!"); |
|
gamepad.begin(); |
|
} |
|
|
|
void loop() { |
|
if (gamepad.isConnected()) { |
|
// test code to automate sending to test RadioReceiver (or any gamepad impl) |
|
Serial.println("Press buttons A and Y. Move all axes to center. Set DPAD to down right."); |
|
gamepad.press(c, BUTTON_A); |
|
gamepad.press(c, BUTTON_Y); |
|
gamepad.setAxis(c, 0, 0, 0, 0, 0, 0, DPAD_DOWN_RIGHT); |
|
delay(500); |
|
Serial.println("Release all buttons. Move all axes to center. Set DPAD to center."); |
|
gamepad.buttons(c, 0); |
|
gamepad.setAxis(c, 0, 0, 0, 0, 0, 0, DPAD_CENTER); |
|
delay(500); |
|
} |
|
}
|
|
|