Constructor for initializing a :py:class:`~easysensors.Led` object for the `Grove LED`_. :param str port = "AD1": Port to which we have the `Grove LED`_ connected to. :param easygopigo3.EasyGoPiGo3 gpg = None: :py:class:`~easygopigo3.EasyGoPiGo3` object used for instantiati
(self, port="AD1", gpg=None, use_mutex = False)
| 1150 | |
| 1151 | """ |
| 1152 | def __init__(self, port="AD1", gpg=None, use_mutex = False): |
| 1153 | """ |
| 1154 | Constructor for initializing a :py:class:`~easysensors.Led` object for the `Grove LED`_. |
| 1155 | |
| 1156 | :param str port = "AD1": Port to which we have the `Grove LED`_ connected to. |
| 1157 | :param easygopigo3.EasyGoPiGo3 gpg = None: :py:class:`~easygopigo3.EasyGoPiGo3` object used for instantiating a :py:class:`~easysensors.Led` object. |
| 1158 | :param bool use_mutex = False: When using multiple threads/processes that access the same resource/device, mutexes should be enabled. |
| 1159 | :raises TypeError: If the ``gpg`` parameter is not a :py:class:`~easygopigo3.EasyGoPiGo3` object. |
| 1160 | |
| 1161 | The ``port`` parameter can take the following values: |
| 1162 | |
| 1163 | * ``"AD1"`` - general purpose input/output port. |
| 1164 | * ``"AD2"`` - general purpose input/output port. |
| 1165 | |
| 1166 | The ports' locations can be seen in the following graphical representation: :ref:`hardware-ports-section`. |
| 1167 | |
| 1168 | """ |
| 1169 | try: |
| 1170 | self.set_descriptor("LED") |
| 1171 | AnalogSensor.__init__(self, port, "OUTPUT", gpg, use_mutex) |
| 1172 | self.set_pin(1) |
| 1173 | except: |
| 1174 | raise |
| 1175 | |
| 1176 | def light_on(self, power): |
| 1177 | """ |