# cPy - cotrollint two servo motors
# Provided by Anthony Vogelaar, Perth Scotland
# rev 0.10  2026-01-15  initial release

import	time
from 	servo_driver	import	Servo		# 7_servo_class.py saved on Esp32 as servo_driver.py

def main():
    servo_1 = Servo(27)
    servo_2 = Servo(26)
    fase    = False
    try:
        while True:
            for _ in range(50):
                time.sleep_ms(100)
                servo_1.exe100()
                servo_2.exe100()
            fase ^= True
            if fase:
                servo_1.goToMax(speed=20)		# 100% = 5   Sec
                servo_2.goToMin(speed=200)		# 100% = 0.5 Sec
            else:
                servo_1.goToMin(speed=200)
                servo_2.goToMax(speed=20)
    finally:
        servo_1.close()
        servo_2.close()
        
        
main()
