Description
You will implement a simple game that uses the lights and button on the board.
Given the command below (where xx is your initials)
xxGame delay pattern target
your board will repeatedly blink the lights in the pattern you specify, until you push the button. If when you push the button the target light is on, the user “wins” and all the lights blink twice at the same time. If the user loses, only the target light is lit up.
Example:
jsGame 500 43567011 5
This would run the game with a delay of 500ms between lights (you will have to scale the delay) and cycle the lights in a pattern of 4, 3, 5, 6, 7, 0, 1, 1. If the user manages to push the button when the 5 light is lit up, they will win.
REQUIREMENTS
• No logic is to be implemented in your C hook code UNLESS it is related to removing the busy delay.
• You may use library functions from the stm32 code to detect button state and parse input.
• It is very important that you structure your code cleanly for this assignment.
• You must name all functions and adapt any menu help instructions appropriately.
• You will have to scale the delay to approximate milliseconds.
• You will have to parse the input pattern and store it in a way that you can cycle through it repeatedly.
DEMONSTRATION
Please note that you must be prepared before offering to demonstrate your code. You must demonstrate the code that you have submitted to the eConestoga dropbox.
For this assignment, you will demonstrate the following items. You may use a lab PC or your own. If needed, you may use a classmate’s VM, but you MUST run your own code and only your own code. You must demonstrate in your regularly scheduled lab period. IF YOU DEMONSTRATE MODIFIED CODE, YOU WILL RECEIVE A LATE PENALTY ACCORDING TO HOW LONG IT HAS BEEN SINCE THE DROPBOX DEADLINE.
1. Your xx_hook.c and xx_asm.s code as taken directly from the drop box compiles.
2. Your code deploys with make program.
3. Your code runs with no parameters provided (sensible defaults).
4. Your code runs as specified.
5. You can demonstrate both cases – that it is possible to both win and lose.
CODE
The code you submit will be evaluated on the following criteria.
FUNCTIONALITY
Your program behaves as specified.
PROPER USE OF REGISTERS, THE STACK, AND LINK REGISTER
Only necessary items (no more, no less) are pushed onto the stack. Your function calls use the link register appropriately.
CODE READABILITY AND STRUCTURE
Your code is properly indented, does not wrap or have long lines, and can be logically understood.
You use subroutines and memory appropriately.
CODE COMMENTS
As this is assembly language, you must extensively comment any code that is unclear (i.e. nearly every line).
SUBMISSION REQUIREMENTS
Paper submission: This assignment requires a single flowchart of the flow of your code. This flowchart should use standard flowchart shapes for steps and decisions, and should correspond with your logic.
Please print the table below, with your name clearly displayed, for marking purposes.
Item Grade
Flowchart / 5
Demonstration
/ 5
Code
Functionality / 5
Proper use of registers, etc. / 5
Readability / Flow / 5
Comments / 5
Code Subtotal:
/ 20
Pre-cap Total:
/ 30
Applicable Cap:
Total: / 30
CAPS
If you do not complete all functionality, the following caps will be applied:
Function Maximum Grade
Hard coded cycle 60%
Button press doesn’t stop cycle 75%
Win / Loss missing 85%
All functions implemented 95%
Does not use a busy delay 100%
Bonus: You do not poll for the button press 105%
SUBMISSION GUIDELINES
PLEASE READ AND UNDERSTAND THE SUBMISSION GUIDELINES BELOW. FAILURE TO CORRECTLY SUBMIT ANY REQUIRED COMPONENT WILL RESULT IN 20% PENALTY PER MISSING OR INCORRECT COMPONENT.
PAPER SUBMISSION
Please print your flowchart and include the grade table. Ensure your name is on all pages.
ELECTRONIC SUBMISSION
Exactly THREE items will be submitted electronically (four if necessary).
• A PDF of your flowchart
• Upload the complete C hook file xx_hook.c.
• Upload your complete assembly file (the xx_asm.s file).
• If necessary, your modified main.c file. This should only be needed if you replace the busy delay.
FOR THIS ASSIGNMENT, PLEASE DO NOT COMPRESS EITHER FILE, AND PLEASE BE CERTAIN YOU HAVE NAMED IT AND YOUR FUNCTIONS CORRECTLY.
Complete file naming and upload guidelines are provided below.
ELECTRONIC SUBMISSION AND FILE NAMING
Often, multiple groups will name their assignment files assignment1.zip (or some other common combination) which results in confusion and complications when downloading and unzipping submitted electronic files.
Please follow the following guidelines for all submissions this term. Failure to follow the electronic submission guidelines may result in a 20% penalty per infraction.
As long as other file naming conventions are followed, you may choose to append an assignment identifier (i.e. “_a1” or something else as appropriate) as the LAST element before the file extension.
DOCUMENT NAMING AND SUBMISSION
Unless otherwise requested, you should only ever submit a single document containing the complete document as specified. This document must be:
• A professionally formatted document adhering to the SET report standard
• A single PDF file, NOT included in a zip
UNLESS INDICATED OTHERWISE, DO NOT SUBMIT THE ASSIGNMENT SPECIFICATION AS A PART OF YOUR DOCUMENT.
Documents should be named with the usernames of all team members as follows:
• Individual assignments: username.pdf (i.e. jsmith.pdf)
• When working alone: username_alone.pdf (i.e. jsmith_alone.pdf)
• When working with a partner: username1_username2.pdf (i.e. jsmith_bjones.pdf)
• When working as a team: username_team.pdf (i.e. jsmith_team.pdf – but be certain to include all team members on report title page)

