[Solved] PROG1360 ASSIGNMENT 4 BLINKING LIGHTS AND SENSORS SOLVED

$25

File Name: PROG1360_ASSIGNMENT_4__BLINKING_LIGHTS_AND_SENSORS_SOLVED.zip
File Size: 536.94 KB

SKU: [Solved] PROG1360 ASSIGNMENT 4 – BLINKING LIGHTS AND SENSORS SOLVED Category: Tag:
5/5 - (1 vote)

This assignment builds on the labs and assignments so far.

The Demonstration section of this document outlines the items you are required to show.

Tasks

You will implement a new simple game that uses the lights and accelerometer on the board.

Given the command below (where xx is your initials)

xxTilt delay target game_time

your board will turn on the light(s) according to the X and Y accelerometer values retrieved via the I2C interface. See the appropriate lab for details of retrieving these values.

When the target light has been kept on for the target time, you win, and the board flashes all lights twice (as you did in the last assignment).

If you do not manage to turn on the lights in the allotted game time (specified in seconds) you lose, and the single target light will be turned on.

Example:

jsGame 500 5 30

This would run the game with a target of light 5 being on for 500ms to win. The game will run for 30 seconds in this case before it would end with a loss

Note that you will have to find a way to time your game in this case, busy_delay is not going to be useful for you.

Requirements

  • No logic is to be implemented in your C hook code unless it is related to eliminating the busy delay.
  • You may use library functions from the stm32 code to parse input.
  • You will have to use the I2C functions to retrieve accelerometer values.
  • 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 determine how to count time (approximation is OK).
  • On starting the game, ensure that all lights are first turned off.

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 classmates 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 sudo 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

Your code will be evaluated as follows. Each will be evaluated on a 0 to 5 basis, where 0 is unacceptable or not present, and 5 is excellent.

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).

Document Requirements

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
Demonstration / 5
Code
Functionality / 5
Proper use of registers, etc. / 5
Readability / 5
Comments / 5
Code Subtotal / 20
Total / 25
Applicable Cap:

Caps

If you do not complete all functionality, the following caps will be applied:

Function Maximum Grade
Hard coded delays 60%
Win / Loss missing 80%
Game works but is unplayable 90%
All functions implemented 100%

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] PROG1360 ASSIGNMENT 4 BLINKING LIGHTS AND SENSORS SOLVED
$25