Answered step by step
Verified Expert Solution
Question
1 Approved Answer
igure 2.11 Exercise 2.5 What two lines will be used to get the LEDs in the correct states? There then needs to be a loop
igure 2.11 Exercise 2.5 What two lines will be used to get the LEDs in the correct states? There then needs to be a loop where the pedestrian's push button is tested continually, the program should only jump out of the loop when the button is pressed. Exercise 2.6 What two lines will this loop consist of? As soon as the button is pressed (i.e. after the loop is jumped out of) the amber motorists' light should be turned on, and the green one turned off. There should be no change to the pedestrians' lights. Exercise 2.7 What two lines will accomplish these required output changes? As the flowchart in Figure 2.11 shows, there are quite a few time delays required, and rather than copy the same thing over and over again for each time delay, it makes sense to use a time delay subroutine. Subroutines will be fully discussed in detail in the next section on seven-segment displays, however we will merely use one in this program as the general concept is simple. All we need know for the moment (and this should be familiar from studying the program template) is that when you access a subroutine, the program jumps to a certain place, runs through some instructions, and then returns to where it left of. To access a subroutine, the instruction is call, and to return to the line after
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started