lib-g29 1.0.1

A library for interfacing with the Logitech G29 racing wheel
Documentation
  • Coverage
  • 32.21%
    48 out of 149 items documented10 out of 51 items with examples
  • Size
  • Source code size: 64.12 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.56 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 19s Average build duration of successful builds.
  • all releases: 19s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • EzraEllette/g29
    4 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • EzraEllette

G29

Description

Rust crate for using the logitech G29 steering wheel with force feedback. More Force Feedback options coming soon.

Thanks to @nightmode for their NodeJS library that I frequently referenced. logitech-g29

Example

use lib_g29::{Options, G29, events::Event};

fn main() {
    let g29 = G29::connect(Options::default());

    g29.register_event_handler(
        Event::PlaystationButtonReleased,
        playstation_button_released_handler,
    );

    g29.register_event_handler(Event::Throttle, throttle_handler);

    g29.register_event_handler(Event::Brake, brake_handler);

    g29.register_event_handler(Event::Clutch, clutch_handler);

    while g29.connected() {}
}

fn playstation_button_released_handler(g29: &mut G29) {
    g29.disconnect();
    println!("Playstation button released");
}

fn throttle_handler(g29: &mut G29) {
    println!("Throttle: {}", g29.throttle());
}

fn brake_handler(g29: &mut G29) {
    println!("Brake: {}", g29.brake());
}

fn clutch_handler(g29: &mut G29) {
    println!("Clutch: {}", g29.clutch());
}