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

Function handle_button

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

Source from the content-addressed store, hash-verified

528
529
530def handle_button(regObj):
531
532 port = "AD2" if regObj.group(SENSOR_BUTTON_PORT2_GROUP) else "AD1"
533 button_sensor = get_sensor_instance(port, easysensors.ButtonSensor)
534 if button_sensor:
535 sensors = {"{}: Button Pressed".format(port):known_sensors[port].is_button_pressed()}
536 else:
537 sensors = {port:"technical difficulties"}
538 return sensors
539
540
541def handle_servos(regObj):

Callers 1

Calls 2

get_sensor_instanceFunction · 0.85
is_button_pressedMethod · 0.80

Tested by

no test coverage detected