inhert.py 348 B

12345678910111213141516
  1. import PikaStdDevice
  2. class GPIO(PikaStdDevice.GPIO):
  3. def platformGetEventId(self):
  4. return "gpio"
  5. def __init__(self, pin: str = None, mode: str = None):
  6. super().__init__()
  7. if pin:
  8. self.setPin(pin)
  9. if mode:
  10. self.setMode(mode)
  11. self.enable()
  12. io = GPIO("PA1", "out")
  13. io.close()