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

Method set_pin

Software/Python/easysensors.py:197–214  ·  view source on GitHub ↗

Selects one of the 2 available pins of the grove connector. :param int pin: **1** for the exterior pin of the grove connector (aka SIG) or anything else for the interior one.

(self, pin)

Source from the content-addressed store, hash-verified

195 self.get_port(), self.get_pin_mode(), self.portID))
196
197 def set_pin(self, pin):
198 """
199 Selects one of the 2 available pins of the grove connector.
200
201 :param int pin: **1** for the exterior pin of the grove connector (aka SIG) or anything else for the interior one.
202
203 """
204 if self.port == "AD1":
205 if pin == 1:
206 self.pin = self.gpg.GROVE_1_1
207 else:
208 self.pin = self.gpg.GROVE_1_2
209 elif self.port == "AD2":
210 if pin == 1:
211 self.pin = self.gpg.GROVE_2_1
212 else:
213 self.pin = self.gpg.GROVE_2_2
214 debug("setting pin to {}".format(self.pin))
215
216 def get_pin(self):
217 """

Callers 9

__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80

Calls 1

debugFunction · 0.70

Tested by

no test coverage detected