実際のところ
#include <Arduino.h>
#include <BleGamepad.h>
BleGamepad bleGamepad;
void setup()
{
Serial.begin(115200);
Serial.println("Starting BLE work!");
bleGamepad.begin();
}
void loop()
{
if (bleGamepad.isConnected())
{
Serial.println("Press buttons 5, 16 and start. Move all enabled axes to max. Set DPAD (hat 1) to down right.");
bleGamepad.press(BUTTON_5);
bleGamepad.press(BUTTON_16);
bleGamepad.pressStart();
bleGamepad.setAxes(32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767);
bleGamepad.setHat1(HAT_DOWN_RIGHT);
delay(500);
Serial.println("Release button 5 and start. Move all axes to min. Set DPAD (hat 1) to centred.");
bleGamepad.release(BUTTON_5);
bleGamepad.releaseStart();
bleGamepad.setHat1(HAT_CENTERED);
bleGamepad.setAxes(0, 0, 0, 0, 0, 0, 0, 0);
delay(500);
}
}