Joycon
Device access library for Joycon(Nintendo Switch)
Install / Use
/learn @nobonobo/JoyconREADME
joycon
Nintendo Switch's Joycon Device access library(via bluetooth only)
Reverse engineering info
https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering
Feature
- supported deveces: Joycon(L/R), Pro-Controller
- get: Digial Buttons state
- get: Analog Sticks state
- set: Raw Vibration data
- calibration support for analog stick.
Dependencies
- go get -u github.com/flynn/hid
- go get -u github.com/shibukawa/gotomation
optional
Usage
In advance, you perform Bluetooth pairing for Joycon. (Joycon must be connected before execute below code.)
Note: When Joycon is fitted to the main body, BT sessions are overwritten, so when you connect to PC later, you need to redo pairing.
package main
import "github.com/nobonobo/joycon"
func main() {
devices, err := joycon.Search(joycon.JoyConL)
if err != nil {
log.Fatalln(err)
}
jc, err := joycon.NewJoycon(devices[0].Path, false)
if err != nil {
log.Fatalln(err)
}
s := <-jc.State()
fmt.Println(s.Buttons) // Button bits
fmt.Println(s.LeftAdj) // Left Analog Stick State
fmt.Println(s.RightAdj) // Right Analog Stick State
a := <-jc.Sensor()
fmt.Println(a.Accel) // Acceleration Sensor State
fmt.Println(a.Gyro) // Gyro Sensor State
jc.Close()
}
TODO
- [ ] Deadzone parameter read from SPI memory.
- [x] Rich Vibration support.
- [ ] Set Player LED.
- [ ] Set HomeButton LED.
- [ ] Low power mode support.
- [ ] IR sensor capture.(wip)
Related Skills
node-connect
335.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
82.7kCreate 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
335.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
82.7kCommit, push, and open a PR
