EvoGameController#

class EvoGameController(ble=None, debug=False)#

BLE gamepad reader for Evo controller input.

set_debug(enabled)#

Enable or disable debug logging.

Returns:

None.

isConnected()#

Check whether a controller is connected.

Returns:

Boolean.

latest_raw()#

Read the latest raw controller packet.

Returns:

Raw bytes-like packet, or None before a packet is received.

isPressed(mask)#

Test whether a button bit mask is currently active.

Returns:

Boolean.

getLX()#
getLY()#
getRX()#
getRY()#

Read the normalized left or right stick axis.

Returns:

Floating-point axis value, typically from -1.0 to 1.0.

getLT()#
getRT()#

Read the normalized trigger value.

Returns:

Floating-point value from 0.0 to 1.0.

state()#

Return the current decoded controller state.

Returns:

Dictionary containing connection state, axes, triggers and button bits.

begin(timeout_ms=5000)#
begin_by_name(name_pattern, match=..., timeout_ms=5000)#
begin_by_address(addr_type, addr, timeout_ms=5000)#

Scan for and connect to a BLE controller.

Returns:

True on success, otherwise False.

disconnect()#

Disconnect from the active controller if one is connected.

Returns:

None.

update()#

Process pending BLE state and decode the latest input packet.

Returns:

True when still connected and updated successfully, otherwise False.

calibrate()#

Calibrate stick center values from the latest raw controller packet.

Returns:

True when calibration data was available, otherwise False.