Skip to content

Commit 66f61fd

Browse files
committed
Tweak XRP grab ring example to wait on user button pushes
1 parent b03ca23 commit 66f61fd

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

examples/xrp_examples/ex02_grab_orange_ring.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ def find_orange_ring_pipeline(frame):
146146
# Move the servo out of the way of the camera
147147
servo_one.set_angle(90)
148148

149+
# Wait for user button to be pressed to start the example
150+
print("Press the user button to start the example")
151+
while not board.is_button_pressed():
152+
pass
153+
149154
# Open the camera and wait a moment for at least one frame to be captured
150155
camera.open()
151156
time.sleep(0.1)
@@ -184,6 +189,11 @@ def find_orange_ring_pipeline(frame):
184189
# Release the camera, we're done with it
185190
camera.release()
186191

192+
# Wait for user button to be pressed to continue
193+
print("Press the user button to continue")
194+
while not board.is_button_pressed():
195+
pass
196+
187197
# Move the servo to go through the center of the ring
188198
servo_one.set_angle(45)
189199

0 commit comments

Comments
 (0)