Amperometer

class Amperometer(target: MotorBase)

Bases: SensorBase

Amperometer object.

Attributes

targetMotorBase

Target motor object whose electric current is probed by the sensor.

Methods

get_value()

It gets the electric current of the target motor object.

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

It gets the electric current of the target motor object.

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

Parameters

unitstr, optional

The unit to which convert the target electric current. If specified, it converts the electric current and returns only the numerical value as float or integer, otherwise it returns a Current. Default is None, so it returns a Current.

Returns

Current or float or int

Electric Current of the target motor object.

Raises

TypeError

If unit is not a str.

property target: MotorBase

Target motor object whose electric current is probed by the sensor.

Returns

MotorBase

Target motor object whose electric current is probed by the sensor.

Raises

TypeError

If target is not an instance of MotorBase.