def setOutValue(pinNumber, value): if value == 0: cmd = "echo low > " + GPIOCtrl.directionPath(pinNumber) ShellCmd.execute(cmd) else : cmd = "echo high > " + GPIOCtrl.directionPath(pinNumber) ShellCmd.execute(cmd)
def setEdge(pinNumber, type): cmd = "echo " + type + " > " + GPIOCtrl.baseDir + "gpio" + str(pinNumber) + "/edge" ShellCmd.execute(cmd)
def getValue(pinNumber): cmd = "cat " + GPIOCtrl.valuePath(pinNumber) return ShellCmd.execute(cmd)[0].strip('\n')
def setValue(pinNumber, value): cmd = "echo " + str(value) + " > " + GPIOCtrl.valuePath(pinNumber) ShellCmd.execute(cmd)
def setOut(pinNumber): cmd = "echo out > " + GPIOCtrl.directionPath(pinNumber) ShellCmd.execute(cmd)
def setIn(pinNumber): cmd = "echo in > " + GPIOCtrl.directionPath(pinNumber) ShellCmd.execute(cmd)
def freeGpio(pinNumber): if os.path.exists(GPIOCtrl.baseDir + "gpio" + str(pinNumber)) : cmd = "echo " + str(pinNumber) + " > " + GPIOCtrl.baseDir + "unexport" ShellCmd.execute(cmd)
def requestGpio(pinNumber): if os.path.exists(GPIOCtrl.baseDir + "gpio" + str(pinNumber)) : return cmd = "echo " + str(pinNumber) + " > " + GPIOCtrl.baseDir + "export" ShellCmd.execute(cmd)