I am new to vexcode, and I am working through some problems with my students that we have been unable to solve.
Is there any way to add an additional “When Started” command on a vexgo project. The project includes the Code Base.
Here is the scenario/challenge that I put forth to my students. Imagine you were a Mars Rover Programmer. Using your eye forward sensor, you would like to program your rover to scan a 1 meter by 1 meter area for obstructions, stop at the obstacles, wait for obstacles to be removed and continue to search. We have been able to solve this for a line. They can find the object and wait for it to be removed and continue searching. We have included a forever comand so that it will keep finding obstacles. What we can not do is attach this to commands that make it search the whole square area. Any ideas? Thank you.
I realized I did not answer this, from the time I took to look through the program I did not see anyway to add extra when started block, I usually combat this by adding a custom block and having it run when started, but I am not sure this program allows that. This might be something worth trying though.
From above does some of this code help? You can replace the red with the boundry if you are taping one on the ground, this is the simplest way although I might be able to code one without a physical boundary, but would take a lot of explaining to your kids as it would use a variable as the main way to stay in the lines. I am available to troubleshoot and give advice with coding, but I am not familiar with GO so this is a little bit out of my comfort zone, but that is how we all learn, isn’t it.
Thank you so much for your help. I am getting closer. Here is my new code that used what you mentioned and some additions. Unfortunately, now when it gets to the red outside it turns right at turn A and B, then it turns left on next turn. I thought it was working, then it would turn the wrong way. Any thoughts. Again thanks for working with me.
Thank you so much. I think the variable piece is a bit over my students’ heads. I really appreciate all of your help. It was nice to collaborate on this. I guess there is a leaning curve. Thank you again.
Your welcome! If you need anymore help just ask! there is also a way where you code it all without any loops could work, if you want me to give a screenshot I can, it might be a little delayed though, but I will get back to you!