SPIKE Prime Tutorial 1.6: Distance Sensor

preview_player
Показать описание
0:00 Overview
0:29 Blocks: Starting Motors
1:44 Blocks: Stopping motors
3:06 Python: Distance Closer Than
4:28 Python: Start/Stop based on Distance

👦 Video Created by Summer 2020 Multimedia Team (Jared Jaramillo, Hyejin Im)

💻 Python Code
YouTube doesn't allow angled brackets, so in the "elif" statement make sure to replace the text with the correct symbols!
--------------------------------------------------------------------------------
while True:

if dist_cm == None:

elif dist_cm (greater than or equal to) 10:

else:
--------------------------------------------------------------------------------
Рекомендации по теме
Комментарии
Автор

Hey Lego Engineering, I think you should include the Build steps to build the robot as an attachment or a link. Many beginners would not know how to build this robot.

ReallyBigWorld
Автор

How do you the 2nd part of the code you used but using the blocks in the SPIKE app? Thank you!

SFlores
Автор

I have tried but it doesn’t work - mine is just spinning around in circles

davidsagnelli