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

Function wait_for_button

Projects/Empathybot/empathybot.py:118–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

116
117# Wait for Button Press.
118def wait_for_button():
119 gpg.stop()
120 while button.is_button_pressed() is False:
121 time.sleep(0.5)
122 print("Button pressed!")
123
124 gpg.forward()
125 while ds.read() > distance_from_body:
126 time.sleep(0.1)
127 gpg.stop()
128
129 sound("Hello!")
130
131def back_away():
132 gpg.drive_cm(-50)

Callers 1

mainFunction · 0.85

Calls 5

soundFunction · 0.85
is_button_pressedMethod · 0.80
stopMethod · 0.45
forwardMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected