SimLong

class hal.SimLong(handle: int)

Bases: SimValue

Wrapper around a HAL simulator long value handle.

It is not useful to construct these directly, they are returned from various functions.

Wraps a simulated value handle as returned by HAL_CreateSimValueLong().

Parameters:

handle – simulated value handle

get() int

Gets the simulated value.

Returns:

The current value

reset() None

Resets the simulated value to 0. Use this instead of Set(0) for resetting incremental sensor values like encoder counts or gyro accumulated angle to ensure correct behavior in a distributed system (e.g. WebSockets).

set(value: int) None

Sets the simulated value.

Parameters:

value – the value to set

property value