Question

microcontrollers

image.pngimage.png


Question #2 (40 pts): Write a Code according to the circuit shown in Figure 1 and the given requirements below. Figure 1. Keypad circuit This code is going to work based on a number guess game.  The first player will enter a four-digit number by using the number pad. All the digits should be different. (It is not needed to be checked in software). The entered digits will be seen on the first line of the LCD screen during the input. After the 4th digit is entered, the number will be saved and “SAVED” should be displayed on the second line of the screen for 2 seconds then the screen will be cleared. (15 pts) Hint: It is recommended to use keypad reading functions that are supplied in the 2nd Laboratory assignment.  The second player will try to guess the number entered by the first player in ten guesses. If the player cannot find the number in ten guesses, the message “YOU LOSE” will be displayed on the first line of the screen and the number entered by the first player will be printed on the second line of the screen for 5 seconds. If the second player finds the number in ten guesses, the message “YOU WIN” will be displayed on the screen for 5 seconds and LED which connected PIN_B0 will be turned on for 5 seconds (20 pts).  After losing or winning ,the loop should start from the beginning (10 pts).  The first guess “Guess1.” will be seen on the first line and second player will enter his/her guess on the first line in continuation of “Guess1.” Then the microcontroller will give a hint to the player according to the entered guess as shown in Figure 2. The hint will be given according to the digits that were guessed correctly and their places. The number of the correct place and correct digit is represented by prefixed “+” sign, the number of the correct digit with incorrect place is represented by prefixed “-“ sign.For example, if the number to be guessed is “1357” and the second player entered a guess as “1325”, the second player found 2 digits on the right place but 1 digit on the wrong place. Then the hint will be shown as “+2-1” after one space from the entered guess as shown in Figure 2 (35 pts).  After the first guess on the second line “Guess2.” will be written and the second player will enter the second guess on the second line as shown in Figure 2 (10 pts). Figure 2. For the first guess  After the second guess, every guess will be entered in the second line and the previous guess and hint will be seen on the first line of the screen as shown in Figure 3 (10 pts). Figure 3. For the other guesses Simulation files and written codes (c files) should be uploaded to the system and sent to the following email addresses. There is no need for any report or screen video.

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
microcontrollers
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • This is for C programming: You will be given files in the following format: n word1...

    This is for C programming: You will be given files in the following format: n word1 word2 word3 word4 The first line of the file will be a single integer value n. The integer n will denote the number of words contained within the file. Use this number to initialize an array. Each word will then appear on the next n lines. You can assume that no word is longer than 30 characters. The game will use these words as...

  • For a C program hangman game: Create the function int play_game [play_game ( Game *g )]...

    For a C program hangman game: Create the function int play_game [play_game ( Game *g )] for a C program hangman game. (The existing code for other functions and the program is below, along with what the function needs to do) (Also the link to program files (hangman.h and library file) is below the existing code section. You can use that to check if the code works) What int play_game needs to do mostly involves calling other functions you've already...

  • Can someone upload a picture of the code in matlab Write a "Guess My Number Game"...

    Can someone upload a picture of the code in matlab Write a "Guess My Number Game" program. The program generates a random integer in a specified range, and the user (the player) has to guess the number. The program allows the use to play as many times as he/she would like; at the conclusion of each game, the program asks whether the player wants to play again The basic algorithm is: 1. The program starts by printing instructions on the...

  • Python Program Python: Number Guessing Game Write a Python function called "Guess.py" to create a number...

    Python Program Python: Number Guessing Game Write a Python function called "Guess.py" to create a number guessing game: 1. Function has one input for the number to Guess and one output of the number of attempts needed to guess the value (assume input number will always be between 1 and 1000). 2. If no number was given when the function was called, use random.randint(a,b) to generate a random number between a=1 and b=1000. You will also need to add an...

  • USE JAVA Problem 1: Guess a Number You are writing a program for a number guessing...

    USE JAVA Problem 1: Guess a Number You are writing a program for a number guessing game. For playing "Guess a Number", the program will generate a number for player to guess from within a range specified by the player. The program will take as input the lowest number in the range and the highest number in the range from the player, and then a series of guesses of the form: <n,>n, = n, where n is the number guessed....

  • Please help with this Intro to programming in C assignment! Intro to Programming in C-Large Program...

    Please help with this Intro to programming in C assignment! Intro to Programming in C-Large Program 3 - Hangman Game Assignment purpose: User defined functions, character arrays, c style string member functions Write an interactive program that will allow a user to play the game of Hangman. You will need to: e You will use four character arrays: o one for the word to be guessed (solution) o one for the word in progress (starword) o one for all of...

  • Hangman using while and fo loops, if's, and functions.

    I would like to preface this by saying this is NOT a current homework assignment; but it is an assignment from 3 years ago before I dropped out of school. I am self teaching and am revisiting an old assignment. I am NOT asking for the entire program, I'm simply looking for help building the skeleton for the initial start of the game.MORE INFO: Player 1 will enter word(of any length / i have been using "Testing") for Player 2...

  • Write a program to play "guess my number". The program should generate a random number between...

    Write a program to play "guess my number". The program should generate a random number between 0 and 100 and then prompt the user to guess the number. If the user guesses incorrectly the program gives the user a hint using the words 'higher' or 'lower' (as shown in the sample output). It prints a message 'Yes - it is' if the guessed number is same as the random number generated. ANSWER IN C LANGUAGE. ====================== Sample Input / Output:...

  • Phone Number Problem (Use Object-Oriented Programming Style. Otherwise there will be no credit) Write a C++ program tha...

    Phone Number Problem (Use Object-Oriented Programming Style. Otherwise there will be no credit) Write a C++ program that can convert any 7-digit telephone number into corresponding words where the equivalence of each digit and its corresponding characters is defined in the telephone keypad, which is shown in the following table: ABC 4 1 JKL MNO 8 TUV WXYZ In the keypad, there is no equivalence for digit 1 and 0, but in reality, the phone number might contain those two...

  • Please do it by C++ programming! By completing this project, you will demonstrate your understanding of:...

    Please do it by C++ programming! By completing this project, you will demonstrate your understanding of: 1) Arithmetic operations (addition, subtraction, multiplication, division, modulus) 2) Conditional statements (If, If-Else, If-ElseIf-Else, Conditional Operator, Switch) 3) Precondition, postcondition, and indexing loops (Do-While, While, For) 4) Standard text file operations (open, close, read, write) 5) Modularizing code by breaking into functions (including functions with input parameters, and ones that return a specific data type) There is a number guessing game similar to MasterMind...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT