Highlights
Aims
This laboratory exercise exposes students to creating a system that brings together several different elements to achieve an overall aim. It also highlights the use of a serial interface (I2C) and the creation of hardware APIs.
There are also some aspects of real-time behaviour needed in the interaction with the user.
It is expected that students will be able to apply techniques investigated during the semester to develop a moderately complex system using a range of software techniques and hardware peripherals.
Method
You are asked to develop an LED game based upon a game board interfaced over I2C to the processor As a challenge exercise the LED display is to be enhanced by using multiplexing and the game logic extended. Assessment – Refer to Canvas for assessment and submission details.
Assessment is based on correct completion of design, implementation and demonstration of operation by video. The experiment is to be completed individually.
Section 1 – Basic LED Display and Button API
Write a C module to provide a flexible interface to the game board. As part of the API developed It should provide at least the:
• Ability to select a single LED to be illuminated or none-at-all.
• Polling of the 4 switches on the board.
Clarity in the design of the API is important. It should be based upon a sensible lower-level abstraction of the GPIO expander being used e.g. routines to read/write arbitrary register over the I2C bus. These routines should then be used to implement the above API. The user of the API should not need be concerned with details of the hardware.
Section 2 – Basic game
Use the API developed in section 1 to build a LED chaser game. Basic operation is as follows:
1. A single LED is illuminated at a time.
2. The LED moves up/down/left/right at a timed rate. The rate should reduce as the game advances. 3. The 4 buttons control the direction of movement (they do NOT cause the LED to move). 4. The object of the game is to visit all four corners of the grid in any order. A corner may be visited more than once while accomplishing this. Each time this is achieved the score increases.
5. The player attempts to do the above while preventing the LED moving off the edge of the board. 6. The game ends when the player fails to keep the LED on the board.
The score is then displayed by illuminating the appropriate LED i.e. the LEDs are number 0-15 across the rows top to-bottom. If the score is more than 15 a light chaser should be substituted for the actual score.
The above game logic may be implemented as a single loop incorporating a minor delay.
The code must remain responsive to the buttons at-all-times i.e. button presses must be captured at a suitably higher rate than the LED movements – otherwise the game is very frustrating.
Section 3 – Multiplexed LED display
Extend the interface to the game board to implement a multiplexed display. This will allow multiple LEDs to be on at once. Expand the API to provide the ability to turn individual LEDs on or off without affect the other LEDs. Obtaining state of the buttons is still part of the API.
You will need to incorporate the switch polling into the multiplexing code as accessing the switches at an arbitrary moment would interfere with the multiplexing.
The multiplexing must be driven by the PIT and operate independently of the game code below. Section 4 – Snakes Alive!
Implement a cut-down version of the game snake:
• The LED moves as before but it has a tail.
• The length of the tail increases by one each time the snake changes direction.
• The objective of the game is to have a snake of length 16 i.e. filling the board.
• The game ends if the head of the snake tries to leave the board or intersects the body of the snake. • The final length of the snake is the final score.
You may alter the game description to be more interesting providing it presents a similar programming challenge. This should be first confirmed with a lab supervisor as being suitable.
This IT Assignment has been solved by our IT Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.