Skip to content

brian.sensors

brian

SensorException class objects

class SensorException(Exception)

Default sensor Exception

SensorAlreadyClosedError class objects

class SensorAlreadyClosedError(SensorException)

Thrown when trying to access closed Sensor

SensorNotReadyError class objects

class SensorNotReadyError(SensorException)

Thrown when trying to read values from a sensor that is not ready.

This is the base class for sensor readiness exceptions. Catching this exception will also catch SensorIncompatibleTypeError and SensorNotConnectedError.

SensorIncompatibleTypeError class objects

class SensorIncompatibleTypeError(SensorNotReadyError)

Thrown when a sensor of a different type than expected is connected.

Catching this exception will also catch SensorNotConnectedError.

SensorNotConnectedError class objects

class SensorNotConnectedError(SensorIncompatibleTypeError)

Thrown when no sensor is connected to the specified port.

SensorPortAlreadyInUseError class objects

class SensorPortAlreadyInUseError(SensorException)

Thrown when trying to register sensor or sensor probe with autodetect to already used port

get_wait_until_timeout_ms

def get_wait_until_timeout_ms() -> int

Get the current timeout value for waitUntilReady operations in milliseconds

set_wait_until_timeout_ms

def set_wait_until_timeout_ms(timeout_ms: int) -> None

Set the default timeout value for waitUntilReady operations in milliseconds. (Wait until ready is invoked in all sensor read operations and constructor calls)

Arguments:

  • timeout_ms - Timeout in milliseconds for internal wait-until-ready calls.
  • positive: wait up to that many milliseconds
  • 0 or negative: return/raise immediately without waiting