Skip to content

Commit 3439047

Browse files
committed
Fix XRP touch drive example
Should have been updated in 9c875a0
1 parent 9c875a0 commit 3439047

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/xrp_examples/ex01_touch_drive.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@
106106

107107
# Loop to continuously read touch input and drive around
108108
while True:
109-
# Read touch input
110-
x, y, touch_num = touch_screen.get_touch()
111-
112-
if touch_num > 0:
109+
# Check if there is touch input
110+
if touch_screen.is_touched():
111+
# Read touch coordinates
112+
x, y = touch_screen.get_touch_xy()
113113
# Check if the stop button was pressed
114114
if (center_x - btn_stop_cx <= x <= center_x + btn_stop_cx and
115115
center_y - btn_stop_cy <= y <= center_y + btn_stop_cy):
@@ -141,4 +141,4 @@
141141
break
142142

143143
# Clear the display
144-
display.clear()
144+
display.splash()

0 commit comments

Comments
 (0)