Constructor for instantiating a :py:class:`~easysensors.Servo` object for a (or multiple) `servo`_ (servos). :param str port = "SERVO1": The port to which we have connected the `servo`_. :param easygopigo3.EasyGoPiGo3 gpg = None: :py:class:`~easygopigo3.EasyGoPiGo3` object
(self, port="SERVO1", gpg=None, use_mutex=False)
| 1509 | """ |
| 1510 | |
| 1511 | def __init__(self, port="SERVO1", gpg=None, use_mutex=False): |
| 1512 | """ |
| 1513 | Constructor for instantiating a :py:class:`~easysensors.Servo` object for a (or multiple) `servo`_ (servos). |
| 1514 | |
| 1515 | :param str port = "SERVO1": The port to which we have connected the `servo`_. |
| 1516 | :param easygopigo3.EasyGoPiGo3 gpg = None: :py:class:`~easygopigo3.EasyGoPiGo3` object that we need for instantiation. |
| 1517 | :param bool use_mutex = False: When using multiple threads/processes that access the same resource/device, mutexes should be enabled. |
| 1518 | :raises TypeError: If the ``gpg`` parameter is not a :py:class:`~easygopigo3.EasyGoPiGo3` object. |
| 1519 | |
| 1520 | The available ports that can be used for a `servo`_ are: |
| 1521 | |
| 1522 | * ``"SERVO1"`` - servo controller port. |
| 1523 | * ``"SERVO2"`` - servo controller port. |
| 1524 | |
| 1525 | To see where these 2 ports are located, please take a look at the following graphical representation: :ref:`hardware-ports-section`. |
| 1526 | |
| 1527 | """ |
| 1528 | try: |
| 1529 | self.set_descriptor("GoPiGo3 Servo") |
| 1530 | Sensor.__init__(self, port, "OUTPUT", gpg, use_mutex) |
| 1531 | except: |
| 1532 | raise |
| 1533 | |
| 1534 | def rotate_servo(self, servo_position): |
| 1535 | """ |
nothing calls this directly
no test coverage detected