get_motor

get_motor(pin: int, angles: list[int]) MotorBase[source]

Factory function to create and initialize a Motor instance.

Parameters:
  • pin (int) – The GPIO pin number.

  • angles (list[int]) – A list containing [open_angle, close_angle].

Returns:

An initialized Motor instance or a dummy MotorBase if initialization fails.

Return type:

MotorBase