def _gpio_get_pin(self, pin):
if (GPIO.getmode() == GPIO.BOARD and self.GPIOMode == 'BOARD') or (GPIO.getmode() == GPIO.BCM and self.GPIOMode == 'BCM'):
return pin
elif GPIO.getmode() == GPIO.BOARD and self.GPIOMode == 'BCM':
return self._gpio_bcm_to_board(pin)
elif GPIO.getmode() == GPIO.BCM and self.GPIOMode == 'BOARD':
return self._gpio_board_to_bcm(pin)
else:
return 0
评论列表
文章目录