Lego robotics soccer nxt programming download


To do this we download this program into our Soccer Robot, and run it. When placed on your Robot Soccer mat, the robot should do nothing if placed inside the playing field, but should retreat backwards if placed anywhere on the white border surrounding the Soccer playing field. This video demonstrates this. If your robot goes backwards into the Soccer field when placed on white, and does nothing when placed in other parts of the Soccer field , your code snippet has been tested and proven reliable.

It can now be used as part of a Soccer playing program. When everything is good, go on to the next step where we can find out how our Soccer Robot finds the ball! Soccer Tactics 1 - Stay on the Soccer Field! Which readings will we use to tell our robot that it has left the Soccer field? How could we tell the Robot to fix this problem?? Let us look at the following code.

If your robot does not behave this way, they are several possible reasons. Has the light changed? There are lots of things we can tell our robot to do after it finds the ball. However, just so we can test that our code works, let us tell our robot to go forward one rotation each time the ball is seen. The code above causes motors A and C to turn one rotation, causing the robot to go a short way forwards.

The loop in the code above causes the whole code to keep repeating forever, or until we turn our robot off. This complete program causes the Robot to keep finding the Soccer ball, and following it - which is what we wanted.

Download this program to your robot, and test it to see that your robot does what you want it to do. If there are problems, carefully check the diagrams above to make sure you have understood the method we have outlined above.

When everything is good, go on to the next step to find out how to tell your robot which is your opponent's goal! Soccer Tactics 2 - Find the Ball! The circled loop above will allow motors A and C to continue running backwards sending the Robot backwards until the Robot is back in the Soccer field.

The code above is quite sufficient to tell our Soccer Robot to go back to the mat. They will continue running after leaving the loop. This may confuse us when this code is inserted in to our Soccer program. It is important to test that this code works, before using it as part of a bigger Soccer program. To do this we download this program into our Soccer Robot, and run it. When placed on your Robot Soccer mat, the robot should do nothing if placed inside the playing field, but should retreat backwards if placed anywhere on the white border surrounding the Soccer playing field.

This video demonstrates this. If your robot goes backwards into the Soccer field when placed on white, and does nothing when placed in other parts of the Soccer field , your code snippet has been tested and proven reliable. It can now be used as part of a Soccer playing program. When everything is good, go on to the next step where we can find out how our Soccer Robot finds the ball! Soccer Tactics 1 - Stay on the Soccer Field!