Tachometer

class Tachometer(target: RotatingObject)

Bases: SensorBase

Tachometer object.

Attributes

targetRotatingObject

Target rotating object whose angular speed is probed by the sensor.

Methods

get_value()

It gets the angular speed of the target rotating object.

get_value(unit: str | None = None) AngularSpeed | float | int

It gets the angular speed of the target rotating object.

If a unit is set, then it converts the angular speed to that unit and returns only the numerical value as float or integer.

Parameters

unitstr, optional

The unit to which convert the target angular speed. If specified, it converts the angular speed and returns only the numerical value as float or integer, otherwise it returns an AngularSpeed. Default is None, so it returns an AngularSpeed.

Returns

AngularSpeed or float or int

Angular speed of the target rotating object.

Raises

TypeError

If unit is not a str.

property target: RotatingObject

Target rotating object whose angular speed is probed by the sensor.

Returns

RotatingObject

Target rotating object whose angular speed is probed by the sensor.

Raises

TypeError

If target is not an instance of RotatingObject.