Skip to content

Instantly share code, notes, and snippets.

@topshed
Last active April 15, 2024 15:14
Show Gist options
  • Save topshed/8483daa0ab4643dc24e3246cc8d6e3ec to your computer and use it in GitHub Desktop.
Save topshed/8483daa0ab4643dc24e3246cc8d6e3ec to your computer and use it in GitHub Desktop.
LEGO Spike Prime snippets for CoderDojo
@topshed
Copy link
Author

topshed commented Jan 11, 2024

Detecting obstacles

Add a distance sensor to the front of your robot.
bot_with_uds1
bot_with_uds2

When the left button is pressed, the bot will start moving forward.

If it detects an obstacle closer than 10cm, it will stop.

detect_obstacle

NEXT: Detecting colours

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment