A lib to encode/decode Joycon Bluetooth packet.

libjoycon CMake

A Joycon packet encoding and decoding lib

Build

The library itself only links to the libm (math lib):

mkdir build && cd build
cmake ..
make

If you want to build examples, the HIDAPI lib is a must. The OpenGL and GLUT/Vulkan is necessary to build IMU Mapping. Configure the project with BUILD_EXAMPLE as follows:

cmake -DBUILD_EXAMPLE=ON ..

Python bindings

If swig is installed, bindings for python will also be built.

To use the Python examples, install hidapi(also and taichi to run the taichi example) in pip. In Linux, remember to build the hidapi manually in order to connect to Joycon through Linux hidraw API:

git clone --recursive https://github.com/trezor/cython-hidapi.git
python setup.py build --without-libusb

Usage

Please refer the programs in examples.

Note

Note that this library does not contain Bluetooth/USB HID implementation, you can use one on a specific platform, e.g. hidapi on Linux/Win, to read/send raw packets, and use this library to extract/encode information from/to the packets.

Having fun

What can it do? Check these tweets:

IIInoki - Map Joycon to a cube

IIInoki - Midi to Joycon rumble

Credits

Owner
Inoki
FOSS @KDE Community, contributing to some other projects.
Inoki
Similar Resources

🪴💧 A Bluetooth Low Energy (BLE) soil moisture sensor.

🪴💧 A Bluetooth Low Energy (BLE) soil moisture sensor.

b-parasite b-parasite is an open source Bluetooth Low Energy (BLE) soil moisture and ambient temperature/humidity sensor. Features Soil moisture senso

May 12, 2022

Dongle to connect a bluetooth PS3 controller to the Gamecube 🎮

Dongle to connect a bluetooth PS3 controller to the Gamecube 🎮

GamecubeBT An arduino based bridge to connect a bluetooth PS3 controller to the Gamecube. Homemade Wavebirds, because the TV is too far from the couch

May 4, 2022

Arduino Sketch and a Web Bluetooth API for loading models and running inference on the Nano Sense 33 BLE device.

Arduino Sketch and a Web Bluetooth API for loading models and running inference on the Nano Sense 33 BLE device.

TF4Micro Motion Kit This repo contains the Arduino Sketch and a Web Bluetooth API for loading models and running inference on the device. Install and

May 6, 2022

The littlest Bluetooth macro pad

The littlest wireless macro pad! AWWWWW!!! (c) 2021 Zack Freedman and Voidstar Lab. Licensed CC-BY-NC (credit me and don't sell it) Built partially on

Feb 26, 2022

Bluetooth low energy (BLE) tracker for ESP32

BLEcker Bluetooth low energy (BLE) tracker for ESP32 This software is written for ESP32 boards to track BLE devices. It can be used for your smart hom

Apr 23, 2022

A handy little system information monitor using and ESP32 + ILI9488 TFT. Receives data over Serial Bluetooth.

A handy little system information monitor using and ESP32 + ILI9488 TFT. Receives data over Serial Bluetooth.

Bluetooth-System-Monitor A handy little system information monitor using and ESP32 + ILI9488 TFT. Receives data over Serial Bluetooth and thus giving

May 19, 2022

ControllaBLE - A retro-controllers to Bluetooth BLE adapter

ControllaBLE - A retro-controllers to Bluetooth BLE adapter

ControllaBLE - A retro-controllers to Bluetooth BLE adapter This is an ESP32 based controller adapter that outputs as a dual joypad through Bluetooth

Dec 1, 2021

Bluetooth Monitor port for the ESP32

Bluetooth Monitor port for the ESP32

ESP32 BT Monitor What is it? This is a (at the moment partial) port of andrewjfreyer/monitor for the popular and super cheap ESP32 boards. For a more

May 14, 2022

Bluetooth Gateway for Phantom Remote Control based on ESP32

Bluetooth Gateway for Phantom Remote Control based on ESP32

Phantom remote control Bluetooth gateway An ESP3232 firmware for the gateway of Phantom remote control, which can push the temperature and humidity data of Phantom remote control through LAN, and also support to control Phantom remote control to send and receive IR data through LAN.

Jan 23, 2022
Comments
  • Improve python examples and readme

    Improve python examples and readme

    After seeing your Twitter video I tried running the examples. I ran into a few problems that I had to solve, so I made these changes to make it easier for the next person :)

    • Explain swig is needed for python bindings
    • De-hardcode midi device name
    • Print error if can't connect to joycon
  • use stdint to fix build on macOS

    use stdint to fix build on macOS

    Signed-off-by: TennyZhuang [email protected]

    Failed to build on macOS ARM

    Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000 arm64
    

    Error:

    make
    Consolidate compiler generated dependencies of target joycon
    [ 12%] Building C object src/CMakeFiles/joycon.dir/imu.c.o
    In file included from /Users/tianyizhuang/Projects/libjoycon/src/imu.c:3:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/string.h:141:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/sys/_types/_rsize_t.h:30:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/machine/types.h:37:
    In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/arm/types.h:55:
    /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/sys/_types/_int8_t.h:30:31: error: typedef redefinition with different types ('signed char' vs 'char')
    typedef signed char           int8_t;
                                  ^
    /Users/tianyizhuang/Projects/libjoycon/include/types.h:12:14: note: previous definition is here
    typedef char int8_t;
    

    Use stdint to avoid redefinition.

base64 single header encode/decode

b64.h base64 single header encode/decode #include <stdio.h> #include "b64.h" // strings are stored on the heap, don't forget to free() them int main(i

Mar 28, 2022
yariv.h is a single C/C++ header to encode and decode SPIR-V shaders into a more compressed form I've called YARI-V.

YARI-V yariv.h is a single C/C++ header to encode and decode SPIR-V shaders into a more compressed form I've called YARI-V. YARI-V is an alternative e

May 3, 2022
Exploits the Wii U's bluetooth stack to gain IOSU kernel access via bluetooth.

BluuBomb Exploits the Wii U's bluetooth stack to gain IOSU kernel access via bluetooth. For a more detailed write-up see WRITEUP.md. Not to be confuse

May 12, 2022
Bluetooth Joystick : A wireless joystick with ESP-32 microcontroller and Dual Axis Joystick Module using the Bluetooth connectivity.
Bluetooth Joystick : A wireless joystick with ESP-32 microcontroller and Dual Axis Joystick Module using the Bluetooth connectivity.

BluetoothJoystick Bluetooth Joystick : A wireless joystick with ESP-32 microcontroller and Dual Axis Joystick Module using the Bluetooth connectivity.

Feb 24, 2022
An easy to decode base64 modification.

crzy64 An easy to decode base64 modification. This is a base64 modification designed to simplify the decoding step. For the four encoded bytes, it onl

May 2, 2022
gr-nrf24-sniffer is a tool to receive and decode wireless traffic from nRF24L01(+) modules

gr-nrf24-sniffer What is this? gr-nrf24-sniffer is a tool to receive and decode wireless traffic from nRF24L01(+) modules (or older nRF24xxx) using GN

Feb 18, 2022
Photon OS DPDK and Packet Generator, RT Test, TF2 docker image.

photongen Photon OS DPDK and packet generator , cyclictest , TF2 with CUDA docker image. DPKD libs The build proccess builds and installs all shared l

Feb 7, 2022
AX.25 protocol (packet radio and APRS) interface / bridging / switching / terminal related software for Linux

CB3ROB-AX25-TOOLS-LINUX 2021-11-23T00:58:49Z (TUESDAY) cb3rob-kiss-tcp-attach.c links ax0 interface to KISS-TCP TNC, soundmodem (direwolf), or multipl

Jan 1, 2022
A native plugin for Unity that provides simple packet division and restoration.

uPacketDivision This is a native plug-in that divides a given data (System.IntPtr or array) into specified sizes and restores them regardless of the i

Feb 20, 2022
Cloud Native Data Plane (CNDP) is a collection of user space libraries to accelerate packet processing for cloud applications.

CNDP - Cloud Native Data Plane Overview Cloud Native Data Plane (CNDP) is a collection of userspace libraries for accelerating packet processing for c

May 10, 2022