Project 8: Turn to Face North
Share
Project 8: turn to face north
You will need a compass sensor for this. (If you don’t have one, you can buy one from the shop)
To activate the compass sensor block, select options -> show setup button
Click Advanced mode in the top right.
Click 9D-Compass
Press OK.
Now when you place an IF block, you should be able to select Compass check as the condition.
Here we can adjust the angles we want to condition on.
For example, Target 30 deg Range 20 deg would mean between 10 degrees and 50 degrees.
In our project, we can say Target 0 deg Range 20 deg to see if the robot is facing forward (from 340 to 20 deg), and if not, check if it is facing right or left by checking target 90 range 90.