In This challenge we need to create a robot that can
1. Not fall off the edge of a table with thick colored lines around it and
2. stop and make a noise when it detects a yellow piece of tape on the table.
Reflection:
In completing this challenge I learned how to get the color sensor to work, but more importantly I learned in-depth how the switch block works.
One thing that went well was that it worked the first time around, or at least the core idea of it. It basically uses the same concept as standard program does, where a weird angle guarantees success at some point. after some adjustments, id say that I've made that.
The biggest thing that didn't go as planned actually happened before I started the challenge. In the lesson I did before we had to make a robot that would follow a colored line. For a period of time it wouldn't work, it detected the white table as the same color as the yellow line.
turns out the problem was that the "default case" was set to yellow, rather than "no color" so when I made this program I was sure to keep that bug out of it.
Another thing is that it would frequently fall off the edge, as it would go to the edge at an angle that made it so that the wheel fell off before the color sensor could tell it not to.
I solved this by placing the color sensor on the lever controlled by the medium motor, much further out than its original position.
The one and very big thing i want to improve upon is the speed at which it finds the treasure, because right now, it takes a while. i'm not sure how i could do it though.
here's the pseudocode:
1.Enter big loop
2.Make sure that the medium motor is not moving.
3.If there is green, then go back at power negative 50, for one rotation.
4.Else, if there is yellow, stop, say "game over", enter mini infinite loop, say fantastic, go back to start of min-loop.
5.Default case: Else, if no color, go forward at maximum speed
6. Go back to start of big loop.
I hereby dub this robot, Table Top Treasure Finder.
Here are some pictures and a video:
Comentarios