class ControlLightServo: def __init__(self, onAngle, offAngle, minAngle, maxAngle, minAngleCycleMS, maxAngleCycleMS, gpioPin): self.controlServo = ControlServo(minAngle, maxAngle, minAngleCycleMS, maxAngleCycleMS, gpioPin) self.onAngle = onAngle self.offAngle = offAngle def turnLight_On_Off(self,on): if on == True: self.controlServo.setServoToAngle(self.onAngle) else: self.controlServo.setServoToAngle(self.offAngle) def deInit(self): self.controlServo.deInit()
def __init__(self, onAngle, offAngle, minAngle, maxAngle, minAngleCycleMS, maxAngleCycleMS, gpioPin): self.controlServo = ControlServo(minAngle, maxAngle, minAngleCycleMS, maxAngleCycleMS, gpioPin) self.onAngle = onAngle self.offAngle = offAngle
#!/usr/bin/python from ControlServo import ControlServo from L3G4200D import L3G4200D import smbus import time c = ControlServo() c.test()