From 6b5754655f78a7f93b756ff902ce9fd80d9dc4ec Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 14 Mar 2022 09:04:27 +0100 Subject: feat: add xinput --- src/gyronardo.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/gyronardo.cpp') diff --git a/src/gyronardo.cpp b/src/gyronardo.cpp index 1c75c80..7c01985 100644 --- a/src/gyronardo.cpp +++ b/src/gyronardo.cpp @@ -5,6 +5,7 @@ #include #include +#include constexpr uint8_t SENSOR_ADDRESS = 0x68U; constexpr uint32_t SENSOR_THROTTLE_TIME = 50U; // milliseconds @@ -68,6 +69,8 @@ void setup() << "Gyro Z: " << sensor.gyro_cal_z << "\n"; sout << "Starting..." << endl; + + XInput.begin(); } void loop() @@ -90,4 +93,8 @@ void loop() } sout << "Pitch: " << sensor.getPitch() << " Roll: " << sensor.getRoll() << endl; + + XInput.setJoystick(JOY_LEFT, static_cast(sensor.getRoll()), + static_cast(sensor.getPitch())); + XInput.printDebug(Serial); } -- cgit v1.2.3-18-g5258