Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 9. data wires and the switch block

Chapter 9. data wires and the switch block

The Switch block is used to make decisions about which blocks to run by choosing between two or more alternatives. For example, the WallFollower program in Chapter 7 uses a Switch block that reads the Ultrasonic Sensor and decides whether to move the TriBot toward or away from the wall. In this chapter, you’ll learn how to use the Switch block to make decisions using a value supplied by a data wire, instead of using data directly from a sensor. You’ll also learn how to pass data between the blocks inside the Switch block and the ones that come before or after the Switch block.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial