Robotics- Follow the line challenge

This is our third robotics challenge and as you might have guessed from the title we had to make our robot follow a line that was in a circle. I think that this is the most challenging challenge yet. Now let me show you my code.

Its a little bit similar to the switch block challenge because it has a switch block and a loop block in it. My first block after the starting block is the sensing block, it tells the robot which colour it has to sense. My next block is the in the yes section is the display block. If it does sense the colour it will wink, if it doesn’t it will do its evil eyes. Back to the yes section. After the display block I have put in a move block. I’ve also made it turn because its going in a circle, not in a straight line. Finally I have put the speed on 30 because its not to slow or not to fast. In the no section after the display block I’ve put in a large motor block. Its on for rotations. Then I have made it turn -35 degrees, finally I’ve put the speed on 30. Then the loop bock makes it go on and on without stopping.

Here is the video of my program working.



Switch Block

For the past week we have been concentrating on the switch block. We had to program our robot to go around a big piece of paper with coloured paper stuck on the edges of it. Our robot had to use the sensor to sense the paper and go around in a square. I found this challenging even though it looked really easy. Here is my program.

First of all we had to put in the loop block, that makes it repeat the whole program. then I put in a display block. That makes your robot do things like wink, frown, make noises, put a picture on its screen and more. I call the next block the choice block because the robot can chose whether to do it or not. You can see that their are 2 options, yes and no. If the robot sensors the paper it will do the bricks that are in the yes section. If it doesn’t sense the paper then it will do to bricks that are in the no section. Finally because of the loop brick it will do the whole thing again, and again, and again.

Here is the video of my robot mastering the obstacle. It isn’t perfect but I it was the best that I could do.