Ch10_Solutions_WAM2.2

Ch10_Solutions_WAM2.2 - NEXT It goes to the number index...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 10 Questions 1. What’s are the differences between GOSUB and ON…GOSUB ? GOSUB will execute a subroutine or set of subroutines in a continuous fashion with no regards to the input user input. ON…GOSUB will execute the subroutine that it is commanded to. ON…GOSUB is especially useful when making menus. 2. How do you declare a variable array? UserEntry VAR Byte(#) Where “#” is the number of variables 3. How do you access a particular element in the variable array? UserEntry(#) Where “#” is the index number Chapter 10 Exercises 1. Explain how to use a FOR…NEXT loop with an ON…GOSUB command to cycle through a list of subroutines. FOR Index= 0 TO # ‘#=number of subroutines -1 ON Index GOSUB, SUB1, SUB2, SUB3….SUB#-1
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: NEXT It goes to the number index subroutine according to input 2. Explain how to add a menu item to TerminalOperatedSensorArray.bs2 that gives the operator the option of making a piezospeaker beep. a) Add speaker subroutine name to ON request GOSUB. b) Add 5) Speaker to display menu c) Add subroutine of speaker FREQOUT pin#, 1000, 2000 RETURN 3. Describe the process you would use (keeping the individual testing rule in mind) to add a piezospeaker circuit to your project. a. Build the piezospeaker circuit on the breadboard. b. Run TestPiezoWithFreqout.bs2 from Chapter 8 to test the speaker. c. Integrate the piezospeaker into the program....
View Full Document

Ask a homework question - tutors are online