Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jam1garner/gc-adapter
A Rust library for working with the Nintendo Gamecube Controller Adapter
https://github.com/jam1garner/gc-adapter
Last synced: 4 days ago
JSON representation
A Rust library for working with the Nintendo Gamecube Controller Adapter
- Host: GitHub
- URL: https://github.com/jam1garner/gc-adapter
- Owner: jam1garner
- Created: 2020-11-28T07:01:02.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-07-01T19:54:22.000Z (over 3 years ago)
- Last Synced: 2025-01-03T02:53:59.507Z (5 days ago)
- Language: Rust
- Size: 17.6 KB
- Stars: 13
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gc-adapter
A Rust library for working with the Nintendo Gamecube Controller Adapter## Example
Cargo.toml:
```
gc-adapter = { version = "0.1.2", features = ["libusb"] }
```Code:
```rust
use gc_adapter::GcAdapter;// get adapter from global context
let mut adapter = GcAdapter::from_usb().unwrap();// refresh inputs to ensure they are up to date
adapter.refresh_inputs();// read and display all controller ports
dbg!(adapter.read_controllers());// enable rumble for only ports 1 and 4
adapter.set_rumble([false, false, false, true]);std::thread::sleep(std::time::Duration::from_millis(100));
// on drop all rumble will be disabled and the USB connection
// will be cleaned up
let _ = adapter;
```