JoyConBridge
Easy access to JoyCon data using C++ or Python
Install / Use
/learn @SilverTuxedo/JoyConBridgeREADME
JoyCon Bridge
Easy, simple, object-oriented access to JoyCons.
JoyCon Bridge allows you to access the state of any connected JoyCon, including buttons, analog sticks, accelerometer and gyroscope data - all in a simple and straightforward manner.
C++ Example
#include "JoyCon.h"
#include "connect.h"
#include "exceptions.h"
using namespace joy_con_bridge;
int main()
{
try {
JoyCon left = connect::getLeftJoyCon();
while (true) {
left.poll();
ButtonsState buttons = left.getButtonsState();
AnalogStick stick = left.getLeftStick();
ThreeAxesSensor acc = left.getAccelerometer();
ThreeAxesSensor gyro = left.getGyroscope();
// ...
}
} catch (const JoyConError& e) {
std::cout << "JoyCon error! " << e.what() << std::endl;
} catch (const HidError& e) {
std::cout << "Device error! " << e.what() << std::endl;
}
return 0;
}
Python interface
The sub-project pyjoyconbridge provides the JoyConBridge library as a Python module (pyd).
Example
import pyjoyconbridge
def main():
try:
left = pyjoyconbridge.get_left_joy_con()
while True:
left.poll()
buttons = left.buttons_state
stick = left.left_stick
acc = left.accelerometer
gyro = left.gyroscope
# ...
except RuntimeError as e:
print("Error! " + str(e))
Building pyjoyconbridge
This project uses Boost.Python.
- Install Python.
- Download and configure Boost.
- Set the following environment variables:
BOOST_ROOT: The directory where Boost is located.PYTHON_ROOT: The directory where Python is installed.
- Build using Visual Studio.
If you don't want to change your environment variables, you can manually replace $(...) occurrences in Boost.Python.props.
Limitations
- Only Bluetooth communication is supported.
- No support for sending rumble.
- Windows only (can be resolved by replacing the
hidapiversion used).
Special thanks
-
dekuNukem/Nintendo_Switch_Reverse_Engineering: Detailed information about the JoyCon's protocol
-
CTCaer/jc_toolkit: Sensor calibration implementation
Related Skills
node-connect
339.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.8kCommit, push, and open a PR
