DEPARTMENT OF ENGINEERING COURSEWORK


Term: Epiphany

Academic Year: 2020/21

Module Code: ENGI1171


Title: Computing Assessment – Computing B


Time Required: 30 hours

Deadline(s) for submission: 29 April 2021 by 14:00

Submission instructions: Your submission should be uploaded to duo in advanced of the deadline. All submissions in the Department are electronic and no hard copy is required. The maximum file size that can be accepted is 20 MB.

Format: Please submit your program in an Arduino Source file in “.ino” format.

Penalties for non-compliance: Any failure to adhere to the stated requirements (e.g. using a different complier to program the board) may be treated as a failure to meet the learning outcomes. There is no formulaic application of penalties.

Date for feedback: After the Board of Examiners.


Instructions to Candidates: 

In accordance with University procedures, submissions that are up to 5 working days late will be subject to a cap of the module pass mark, and later submissions will receive a mark of zero.

You should not include a separate cover sheet.

The top of each “.ino” file should also have your anonymous Z code as a comment. Do not include both your anonymous code and your name.

Your submission file should be named using the following convention: ZCODE_ENGI1171.ino


One method of unlocking mobile phones is to use a pin entered on the virtual keyboard that appears when a button is pressed or a suitable motion is detected by the onboard accelerometer.

In this coursework you will use the micro:bit to demonstrate a program that will detect when users bring a mobile phone to view whilst running outdoors in winter. The user exercising outdoors in the cold might want to change the music track or check the time for example.

Once a “viewing state” is detected this can be passed to the phone operating system, the phone or other device can then present different information to the user, use larger touchscreen buttons for input, unlock the screen and so on.

This means you will need to write a program that will analyse data from sensors on the micro:bit and then indicate which status is found via the LED matrix. The program should be reset by using the buttons on the micro:bit.

To meet the basic specification, your program should:

1.  Display an indication that the device is in “measuring state”.

2.  Capture and store a number (default 100) of sequential readings from the accelerometer. You may wish to adjust the number of readings taken but 100 is a sensible default starting position.

3.  For the set of readings determine if the device has been brought up to “viewing state”. One way of doing this would be to calculate the orientation and determine if the device is now orientated for view.

4.  Display an indication that the device is in “viewing state”. For example you could light up all the LEDs when the micro:bit detects that it is being held for view and have a different pattern for measuring.

5.  Return to the “measuring state” when a button is pressed.


This is the basic specification, and you can pass the assignment by just implementing the steps above. However, you are encouraged to think of other ways of refining the program, test them and include them in your code. These might include the use of more than one type of sensor or a more complex algorithm to determine if a “viewing state” has been arrived at.


The submission for this coursework is the source code of the program you have developed.