# Solving the "Secret Message" assignment

Hey there! Really enjoying the Vex VR for my students to play with, but I am confused about how we can drive to a specific location using the “Turn to Heading” block to move from one coordinate to the next in the Secret Message challenge. How do you direct the robot to turn to a specific angle, and then move a specific amount, or point to a specific coordinate. Unless you use a lot of geometry/pythag… and that’s a little beyond what I was hoping for. Am I missing something simple? Any help would be appreciated!

Here is the text of the challenge:
Uncover the secret message using the coordinates below. Use the Turn to heading block and the Pen on the VR Robot, to move from one coordinate to the next in the project below.

1. Move to (-800mm, 400mm)
2. Pen Down
3. Move to (-600mm, -400mm)
4. Move to (-400mm, 400mm)
5. Pen Up
6. Move to (-200mm, 400mm)
7. Pen Down
8. Move to (200mm, 400mm)
9. Pen Up
10. Move to (-200mm, 400mm)
11. Pen Down
12. Move to (-200mm, -400mm)
13. Pen Up
14. Move to (-200mm, 0mm)
15. Pen Down
16. Move to (200mm, 0mm)
17. Pen Up
18. Move to (-200mm, -400mm)
19. Pen Down
20. Move to (200mm, -400mm)
21. Pen Up
22. Move to (400mm, 400mm)
23. Pen Down
24. Move to (600mm, 0mm)
25. Move to (800mm, -400mm)
26. Pen Up
27. Move to (800mm, 400mm)
28. Pen Down
29. Move to (600mm, 0mm)
30. Move to (400mm, -400mm)
31. Pen Up
32. Uncover the secret message
2 Likes

Yeah, pretty much that…

SecretMessage-ATAN2.vrblocks (26.2 KB)

3 Likes

Oof. Well, I suppose they gotta learn trig some time!

Thanks!

1 Like

i have to do this for a class and i simply can not understand it, could you just tell me what the initial secret message says? thank you

No, it’s a secret. But you could, probably, guess it correctly on the first try.

However, you could download *.vrblocks program that I attached to my reply above (look inside triangle) and then upload it to and execute at vr.vex.com to see secret message appear on the screen.

To goal of this lesson is to learn about atan2() function that lets you determine desired heading angle based on the deltaX and deltaY of coordinates that you need to move to.

Regular atan() only returns angle between -90 and +90 deg (i.e. only right side of the circle) and you need to look at signs of both deltaX and deltaY to determine if the heading should be on the other side of the circle.

This was also discussed here: Trig in Vexcode VR and Blocks (Plus VEX VR Project Thread Now)

King Harry wants you to learn trigonometry!

4 Likes

Sorry for multiple posts, but new users are limited to 2 links per post.

I created a unit with assignments stepping up my students knowledge before I assigned them secret message. Here is how my sequence went.

First I thought them to use the distance formula with distance between.

1 Like

Then I taught them a tiny to bit of trig teaching them to solve for angle theta using acos with direct lines. I pasted the X-Y grid on this google draw and taught the kids to draw the triangle labeling Theta, the right angle, Side h and side a.

1 Like

After that, we went over how to calculate the length of the side “a” by subtracting the starting and finishing X values, and had them figure out how to use an if then else to determine if the robot should turn left or right by comparing the Y values with Automatic a.

Finally, we went over 2d lists with this project.

After that, most of them were able to do the project. Although not many of them decided to solve it using a 2d list.

1 Like

Wait why were those posts flagged?

They were automatically flagged by the system as part of spam prevention.

Obviously that wasn’t the case here, so the posts are now visible.

15 Likes

Oh, so @discobot is now old enough to start preschool and begin the process of machine learning…

Obviously, it still needs to learn a lot…

Are you a cool dude from this cartoon, DRow?

11 Likes

Cooler than the Fonz!

4 Likes