gc-adapter

Crates.iogc-adapter
lib.rsgc-adapter
version0.1.2
sourcesrc
created_at2020-11-28 08:24:09.581177
updated_at2020-11-28 08:42:13.026908
descriptionA Rust library for working with the Nintendo Gamecube Controller Adapter
homepage
repositoryhttps://github.com/jam1garner/gc-adapter
max_upload_size
id317380
size16,391
(jam1garner)

documentation

https://docs.rs/gc-adapter

README

gc-adapter

A Rust library for working with the Nintendo Gamecube Controller Adapter

Example

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;
Commit count: 11

cargo fmt