As in Example 7.2, the objective is to turn on an LED when the user presses a
Question:
As in Example 7.2, the objective is to turn on an LED when the user presses a pushbutton switch, and turn it off when the button is released. After the button is pressed and released a specified number of times, a second LED is to turn on and stay lit. Example 7.2 presented an assembly language solution to this problem. A corresponding Pic Basic Pro solution follows. The comments included throughout the code help explain the function of the various parts of the program.
Example 7.2
The purpose of this example is to write an assembly language program that will turn on an LED when the user presses a pushbutton switch. When the button is released, the LED is to turn off. After the button is pressed and released a specified number of times, a second LED is to turn on and stay lit. The hardware required for this example is shown in the following figure: