Chapter 11 is about loop blocks. A loop block cant do anything on its own but when combined with other commands, it can save you a lot of time. To use the loop, simply place the loop into the program and drag the commands you want to repeat into the loop. At the bottom, where you change the setting of the loop box, you have 5 options. you can have the robot loop forever, loop until a sensor is pressed, loop for a certain amount of time, loop for count, and loop for logic. If you want more actions after the loop finishes, place them after the loop. If you select show counter, a data plug appears which tells other blocks the number of loops that block has done via a data wire. If the infinity button is selected, the loop will go forever. If you choose the sensor option, the loop will end when a sensor is activated. If you choose the count option, you can tell the loop how many times you want it to loop. If the logic option is selected, the program shows a data wire which can be connected to a logic block. The final part of chapter 11 is nested loops. Nested loops are useful if you want to loop something then have the program do something else then repeat all of it again. You can loop the loop essentially. Chapter 12 is about switch blocks. A switch block tells the robot to do one thing if a certain thing happens and another thing if it doesn't happen. This can be controlled by many of the same things as the loop block. A switch block also has the ability to do more than two things. If you deselect the flat view box from the switch, it will allow you to do more than two things based on reading from a sensor etc. These blocks should be very useful in our next challenge.
No comments:
Post a Comment