MCPcopy Create free account
hub / github.com/DexterInd/GoPiGo3 / handle_servos

Function handle_servos

Software/Scratch/GoPiGo3Scratch.py:541–550  ·  view source on GitHub ↗
(regObj)

Source from the content-addressed store, hash-verified

539
540
541def handle_servos(regObj):
542 angle = int(regObj.group(SENSOR_SERVO_ANGLE_GROUP))
543 sensors = {}
544 if regObj.group(SENSOR_SERVO_GROUP)=="servo1" or \
545 regObj.group(SENSOR_SERVO_GROUP)=="servos":
546 sensors = handle_one_servo("Servo1", angle)
547 if regObj.group(SENSOR_SERVO_GROUP)=="servo2" or \
548 regObj.group(SENSOR_SERVO_GROUP)=="servos":
549 sensors = handle_one_servo("Servo2", angle)
550 return (sensors)
551
552
553def handle_one_servo(port, angle):

Callers 1

Calls 1

handle_one_servoFunction · 0.85

Tested by

no test coverage detected