ROBOT WALK LOOP
The task is to make your robot look as much as it can like it is walking by moving one wheel just a little, then the other.
Program the robot's first two 'steps'. Use the Large Motor block for each step.
Drag a Wait block after each 'step'. How long do you want your robot to wait between 'steps'? A second is a long time for a robot to do nothing. Try 0.2 of a second.
Program the robot's first two 'steps'. Use the Large Motor block for each step.
Drag a Wait block after each 'step'. How long do you want your robot to wait between 'steps'? A second is a long time for a robot to do nothing. Try 0.2 of a second.
LOOPS
Loops are very useful for saving boring repetition. All the other robot steps will just be the same as these two. Rather than drag more and more Move and Wait blocks down, you can make the program repeat these steps over and over by putting them in a loop.
Drag a Loop block to the first position of your program space.
Drag a Loop block to the first position of your program space.
Drag your program blocks, keeping them in the same order, inside the Loop block.
Change the Loop control by clicking on the infinity sign (∞) at the end of the loop.
Choose Count then type 4 in the box.
Choose Count then type 4 in the box.
Download and run. Did your robot stop after 8 (4 pairs of) steps?
Change the settings on the blocks to give your robot different kinds of walking action.
Can you program it to look like
- an old man
- a running child
- someone with a limp
Name your program and save your Project using File > Save Project As because you will want to use it again later. The best name for a program or project is one which will remind you what it does.
Can you program it to look like
- an old man
- a running child
- someone with a limp
Name your program and save your Project using File > Save Project As because you will want to use it again later. The best name for a program or project is one which will remind you what it does.
SQUARE WALK
Build on your Walk Loop to make your robot “walk” in a square. Start with your walk loop from the last exercise. After it finishes its 8 step loop, make it turn a quarter turn (1 rotation with 1 wheel is one way to do this).
- Make it repeat these action 4 times:
- You could copy your loop and turn blocks 4 times or you could save yourself a lot of bother and put them in another loop..