Skip to main content

Class GryoorSerialInputDevice

Unity Input System custom device that reads throttle and brake axes from an custom Arduino device ("Gryoor") connected over a serial COM port.

public class GryoorSerialInputDevice : InputDevice, IInputUpdateCallbackReceiver

Inheritance​

Implements​

IInputUpdateCallbackReceiver

Remarks​

The Gryoor Arduino pedal board is the custom-built brake/throttle unit used alongside the Fanatec steering wheel. Because it communicates over serial rather than USB HID, Unity's Input System cannot auto-detect it; this class bridges the serial port to an InputDevice so the same UnityEngine.InputSystem.InputAction bindings used for gamepad triggers work transparently for the physical pedals.

Input lines from the Arduino are delimited by INPUT_SEPERATOR (0x0A, newline) and parsed as comma-separated float values each Unity update cycle.

Properties​

brakeAxis​

The brake input axis control, mapping brake values from the Gryoor Arduino device.

public AxisControl brakeAxis { get; }

Property Value​

AxisControl

throttleAxis​

The throttle input axis control, mapping throttle values from the Gryoor Arduino device.

public AxisControl throttleAxis { get; }

Property Value​

AxisControl

Methods​

AddGryoorInput()​

Adds a Gryoor serial input device to the Unity Input System, initialized using configuration inside the project settings.

[MenuItem("Tools/Add Gyroor Serial Input Device")]
public static void AddGryoorInput()

FinishSetup()​

protected override void FinishSetup()

OnRemoved()​

protected override void OnRemoved()

OnUpdate()​

Reads incoming data from the gryoor's serial stream and processes the received input data on input system's update.

public void OnUpdate()