Skip to content

[PXCT-320] Update GS Alvik - snippet improved #2304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,16 @@ Now that all the previous steps have been set, let's see how to make Alvik movin
``` python
from arduino_alvik import ArduinoAlvik
from time import sleep_ms
import sys

alvik = ArduinoAlvik()
alvik.begin()
sleep_ms(5000) # waiting for the robot to setup
distance = 12
distance = 15
degrees = 45.00
speed = 10.00

while (True):

distance_l, distance_cl, distance_c, distance_r, distance_cr = alvik.get_distance()
sleep_ms(50)
print(distance_c)

if distance_c < distance:
Expand All @@ -122,6 +119,7 @@ while (True):
else:
alvik.drive(speed, 0.0, linear_unit='cm/s')

sleep_ms(100)
```

**4. **Connect Alvik to your PC using the cable included in the box, under the tray.
Expand Down
Loading