mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-22 17:12:55 +08:00
17 lines
348 B
Python
17 lines
348 B
Python
|
import PikaStdDevice
|
||
|
|
||
|
class GPIO(PikaStdDevice.GPIO):
|
||
|
def platformGetEventId(self):
|
||
|
return "gpio"
|
||
|
|
||
|
def __init__(self, pin: str = None, mode: str = None):
|
||
|
super().__init__()
|
||
|
if pin:
|
||
|
self.setPin(pin)
|
||
|
if mode:
|
||
|
self.setMode(mode)
|
||
|
self.enable()
|
||
|
|
||
|
io = GPIO("PA1", "out")
|
||
|
io.close()
|