MCPcopy Create free account
hub / github.com/DexterInd/GoPiGo3 / init_light_sensor

Method init_light_sensor

Software/Python/easygopigo3.py:964–976  ·  view source on GitHub ↗

Initialises a :py:class:`~easysensors.LightSensor` object and then returns it. :param str port = "AD1": Can be either ``"AD1"`` or ``"AD2"``. By default it's set to be ``"AD1"``. :returns: An instance of the :py:class:`~easysensors.LightSensor` class and with the port set t

(self, port="AD1")

Source from the content-addressed store, hash-verified

962 self.close_right_eye()
963
964 def init_light_sensor(self, port="AD1"):
965 """
966 Initialises a :py:class:`~easysensors.LightSensor` object and then returns it.
967
968 :param str port = "AD1": Can be either ``"AD1"`` or ``"AD2"``. By default it's set to be ``"AD1"``.
969 :returns: An instance of the :py:class:`~easysensors.LightSensor` class and with the port set to ``port``'s value.
970
971 The ``"AD1"`` and ``"AD2"`` ports are mapped to the following :ref:`hardware-ports-section`.
972
973 The ``use_mutex`` parameter of the :py:meth:`~easygopigo3.EasyGoPiGo3.__init__` constructor is passed down to the constructor of :py:class:`~easysensors.LightSensor` class.
974
975 """
976 return easysensors.LightSensor(port, self, use_mutex=self.use_mutex)
977
978 def init_sound_sensor(self, port="AD1"):
979 """

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected