Spike Prime - Programing Bot - Fedor Agarshev
Back to: List of projects of Spike up Prime Interest in Science and Technology through Games
About the project
This project was inspired by tasks for children on algorithmic thinking. In these tasks, the Child had to give orders to the robot so that it reached the goal. At first, a semblance of such a robot was realized, but already a reality. Then it turned into a game.
In this game, two players play the first one determines the route, goal and starting position of the robot, and the second must go through this route. If the player managed to pass the route for 3 attempts (you can change the number of attempts, depending on what is more convenient for you), then the player receives a point, you need to remember your points yourself. If the player did not cope, then the one who set the route must pass it for the same number of attempts, and if he copes, he will receive a point. If he fails, then the ball will be given to the opponent who was given the task, because he was given too difficult a task. So the players play up to 3 points.
There is also a second version of the game, both players together form a route. After that, everyone is given an agreed number of attempts to complete the route. The winner is the one who passed using the least number of orders. We recommend changing after each attempt so that it does not happen so that one player will see how the other went and will already know how best to go. If both passed for the same number of orders (or failed to pass), then you can assign an additional attempt or agree to a draw.
Video
Build a robot
Building instructions:
- Be careful with the wires so that they do not interfere with the wheels and sensors
Get the robot ready
Python code:
Description of orders for the robot:
- Orders are given by showing a certain color to the color sensor
- After you have shown the desired color, the symbol of this order will appear on the screen. You need to press the right button to confirm the order or the left button to not set it.
- Purple is an order to move forward. After confirming the order, you need to press the force sensor and hold as much as you would like the robot to travel in cm. 1 cm is calculated in 0.2 seconds. You will also hear a beep every time the counter increases. As soon as you finish pressing the force sensor, the order will be remembered.
- Green is movement to the left. After confirming the order using the force sensor, you set how much the robot will turn. For 0.2 seconds, 4.5 degrees are calculated. Every time the counter is charged you will hear a beep. As soon as you release the force sesor, the order will be remembered.
- Blue is the order to move to the right. Works the same as turning left, only turning right.
- Yellow is the order to move forward to the wall. The robot will stop 10 cm from the wall. The order will be remembered immediately after confirmation.
- Red is the run order of orders that are in memory. After confirming this order, the robot will begin to execute orders in the same order in which they were asked. At the end of the execution of orders, he will check whether the conditions of the goal have been met, if so, then "good job" will be posted on the screen.
Before you start playing with each other, try all the orders to get acquainted with them.
Game improvement task
Try to change the passage of the game. For example, for the robot to move from all objects by more than 40 cm. Of course, do not forget to add so that the robot can check all this. If you have ideas, you can add additional orders that you will use in your game.
Evaluate your performance
Think about what you did well and what you could do better next time. And also how could the game be more interesting.
Teacher Resources