In my fourth video I go over how to determine the distance from an obstacle using ultrasonic sensor. I also discuss how perform arithmetic operations and check conditions. You can view the video on YouTube. I created a new channel for this and upcoming videos on the subject.
First of all, you need to download and install mBlock software from here. Then watch the video and follow along. You can download the project for this video here.