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

Method init_button_sensor

Software/Python/easygopigo3.py:1054–1066  ·  view source on GitHub ↗

Initialises a :py:class:`~easysensors.ButtonSensor` 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.ButtonSensor` class and with the port set

(self, port="AD1")

Source from the content-addressed store, hash-verified

1052 return easysensors.Led(port, self, use_mutex=self.use_mutex)
1053
1054 def init_button_sensor(self, port="AD1"):
1055 """
1056 Initialises a :py:class:`~easysensors.ButtonSensor` object and then returns it.
1057
1058 :param str port = "AD1": Can be either ``"AD1"`` or ``"AD2"``. By default it's set to be ``"AD1"``.
1059 :returns: An instance of the :py:class:`~easysensors.ButtonSensor` class and with the port set to ``port``'s value.
1060
1061 The ``"AD1"`` and ``"AD2"`` ports are mapped to the following :ref:`hardware-ports-section`.
1062
1063 The ``use_mutex`` parameter of the :py:meth:`~easygopigo3.EasyGoPiGo3.__init__` constructor is passed down to the constructor of :py:class:`~easysensors.ButtonSensor` class.
1064
1065 """
1066 return easysensors.ButtonSensor(port, self, use_mutex=self.use_mutex)
1067
1068 def init_line_follower(self, port = "I2C"):
1069 """

Callers 2

empathybot.pyFile · 0.80
easy_Button.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected