()
| 116 | |
| 117 | # Wait for Button Press. |
| 118 | def 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 | |
| 131 | def back_away(): |
| 132 | gpg.drive_cm(-50) |