Answered step by step
Verified Expert Solution
Question
1 Approved Answer
odifying the Program 1 . The supplied program will load a new pattern if any of the pushbuttons are pressed. You are to modify the
odifying the Program
The supplied program will load a new pattern if any of the pushbuttons are pressed. You are to modify the program so
that each pushbutton has its own function, as described below. For the sake of the following discussion, we shall label
the rightmost button as button labelled Key on the circuit board and the leftmost button as button Key
Modify the program so that the pattern no longer rotates automatically. Instead, the pattern should rotate to the right
only when button is pressed, and stop when it is released. Similarly, the pattern should rotate to the left only when
button is pressed, and stop when it is released. Pressing button should set the pattern from the switches as it did
initially while pressing button should reload the original startup pattern stored in memory.
Using the gettingstarted.s andor simpleprogram.s as reference, you are to write your own program to implement a
pattern matching system which operates as follows.
The system is to compare the bit value set on the switches to a pattern stored in memory. If the two values match,
then this should be indicated in some manner using the LEDs. You can decide how the LEDs indicate the match.
The system should not be comparing continuously, but should only perform the comparisoncheck when
pushbutton is pressed. The LEDs should not indicate a match before pushbutton is pressed to check for a match. If
the switch value does not match the pattern stored in memory, nothing should happen.
Modify the program in # above to permit the user to change the stored pattern once they have correctly matched the
current pattern correctly. The user should use one of the pushbuttons to indicate that a new pattern is to be captured
from the switches and used as the new target pattern. This pattern should be stored back into memory to replace the
value originally set in the code. Note that the main monitor tool window has a Memory tab at its bottom, which will
allow you to view the contents of the system memory. Use this to verify that the new pattern is stored correctly
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