Book Image

Learning Lego Mindstorms EV3

By : Gary Garber
Book Image

Learning Lego Mindstorms EV3

By: Gary Garber

Overview of this book

Table of Contents (19 chapters)
Learning LEGO MINDSTORMS EV3
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
10
Other Programming Languages
Index

Sound


Using the microphone in your computer, it is very easy to use the Sound Editor to record sounds into a file to be used.

The stock sound files contain all of the system sounds and a variety of robotic noises. There are also recordings for all of the numeric digits. You could easily write a program for a countdown. In the following program, the speaker plays a Count Down using a combination of Switches (or case structures) and Loops. The loop runs five times, and the index of the loop chooses the path of the Switch. Since the index counter on the loop actually counts up, I used a Math block to allow the output to count down. Although I could have written this code using a linear sequence of blocks, I wanted to introduce another example of using a case structure to choose a sequence of commands.