Impose a time limit on entering the correct combination in


Design with Microcontrollers

Lab: Timers and Pulse-Width Modulators

Starting with the code snippet, develop the following enhancements as part of your program. The combination entered by the user must be processed one button-push at a time.

• If in the UNLOCKED state, the user must be able to lock the system by pushing ‘1' anytime.

• Limit the number of unsuccessful attempts allowed by locking out the user permanently after three consecutive failed attempts. In this state, the system must not respond any more to user input. (For extra credit, you may implement a SUPERVISOR state in which the system can only be unlocked by a supervisor using a different five-digit code.)

• Impose a time limit on entering the correct combination in that after the user enters the first symbol of the combination, he or she has five seconds to enter the entire sequence. If the time expires during this process, the user has to enter the entire code again from the beginning.

• Finally, the finite-state machine developed in the function assumes that the combination to the lock is hard-coded. Relax this assumption by extending the functionality of the program to accept new combinations at run time as follows. In the UNLOCKED state, the user must be able to push the button ‘2' to reprogram a new five-digit combination for the system. The system displays a

Enter New Key:

prompt on the terminal. After a new five-digit code is entered, the screen displays

Enter Key Again to Confirm:

and the user enters the code again. If the code is confirmed, system goes back to the UNLOCKED state and the new key is used from hereon. Otherwise the system displays an error and remains in the UNLOCKED state while maintaining the old key. During the reprogramming
phase, the LED blinks.

Attachment:- Lab-Timers and Pulse-Width Modulators.pdf

Request for Solution File

Ask an Expert for Answer!!
Other Engineering: Impose a time limit on entering the correct combination in
Reference No:- TGS01531952

Expected delivery within 24 Hours