P_R_Ultrasonic

P_R_ Touch Ultra


Build Instructions for Sensors

The above stack is all you need for P_R_ Touch Ultra

If you have two stacks that ask the robot to do two different things that it cannot do at the same time, you may want to use a CONTROL block that says "stop other stacks". That way, the robot knows to run that one stack and not the other -- which would cause an error, and would not work.

Note the use of the ultrasonic SENSOR block. It says to "wait" until it senses something less than < 6 cm away.

In this case, "wait" does NOT means "stand still". It means to continue doing whatever you were doing (while you are waiting). Well, what is it you are waiting for? You are waiting for a specific condition to be met before moving on to the next command. 

In this stack, the first light blue sensor block says to wait until the sensor senses something less than 6cm away before stopping.

NOTE!! Do not ask the robot to detect any distances less than 4cm. Our sensors are not that sensitive and those distances WILL NOT WORK!

DO NOT use "=" . It does NOT work well.  Use "greater than" (>) and "less than".  If you tell the robot to stop at <15 cm from an object, it will virtually stop at 15cm. It will stop at 14.999 or anything less than that, so it is about the same as telling it to stop at 15cm. Or, you could even tell it to stop at <15.1.

Look at the second stack. It uses a "forever"  LOOP CONTROL block. 

The "forever" LOOP CONTROL block will cause the robot to repeat the commands within the block over and over forever.

You know it is a loop because there is an arrow at the bottom pointing back up tot he top of the block.


The second stack also uses a "conditional" CONTROL block that uses "if" and "then"

This type of conditional CONTROL only runs the following command IF the described condition is met. In this case the condition is "distance [from sensor] is [less than] 15 cm". The robot will only play the beep if there is something less than 15 cm away from it.

Your tasks: 



PR Touch Ultrasonic




P_R_My Ultra


START POSITION: Robot starts facing the wall, any distance within 10 cm.




P_R_ Wall Ultra

Robot can be placed any random distance greater than (>) 15cm from the wall of your workstation.

Robot moves forward until it is 15cm from the wall

Robot waits in place 1 second.

Robot moves backward until it is 20cm from the wall.

If finished:

P_R_ Keep Distance 

Program your robot to stay 15cm from your hand.

If you move your hand closer, your robot backs away.

If you move your hand farther away, your robot follows it.