0% found this document useful (0 votes)
33 views2 pages

ECSV202 - Practical Test2 - Sem2 2020

The document outlines the instructions for Practical Test 2 in ECSV202, which requires students to create a program in Mbed Studio within 90 minutes. The program must control LEDs based on button presses and switch states, utilizing various APIs such as Timer, Timeout, and InterruptIn. Evaluation criteria are provided, detailing the requirements for functionality, code layout, and commenting, with a total of 42 marks available.

Uploaded by

KGOTSO MORABA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views2 pages

ECSV202 - Practical Test2 - Sem2 2020

The document outlines the instructions for Practical Test 2 in ECSV202, which requires students to create a program in Mbed Studio within 90 minutes. The program must control LEDs based on button presses and switch states, utilizing various APIs such as Timer, Timeout, and InterruptIn. Evaluation criteria are provided, detailing the requirements for functionality, code layout, and commenting, with a total of 42 marks available.

Uploaded by

KGOTSO MORABA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

ECSV202: Practical Test 2 22 Jan 2021

Surname: Student No:

DURATION: 90 minutes TOTAL MARKS: 42


Start time: 13:00
End time: 14:30
End of normal submission: 14:45
End of late submission: 15:15 (with penalties)

Instructions:
1. Create a program in Mbed Studio.
2. Start your source code with 3 lines of comments that states:
a. the name of the program (Practical Test 2)
b. your surname, initials, and student number
c. the date
3. Create, compile, download and test the code for the Software Specification section.
4. Use proper code layout and make sure to comment your code.
5. After finishing the test, make a copy and rename the main.cpp file to <student
numer>_PRAC2.cpp (e.g. S20102102_PRAC2.cpp)
6. Upload this .cpp file onto the Moodle site under the appropriate section.

Hardware used:
1. NUCLEO-F446RE development board with SwLed Shield
a. LED A (LED0 on PA10)
b. LED B (LED2 on PB5)
c. Status LED (LED6 on PA0)
d. Button A (Black PB0 on PC1)
e. Button B (Blue NUCLEO PB on PC13)
f. Switch B (SW0 on PA9)

Software specification:
Create a mbed control program that will do the following:
1. When the Button A is pressed for longer than 1 second, LED A must go ON; make use the
Timer API
2. LED A must be ON for 4 seconds, then it must turn OFF again; make use the Timeout API
3. Even if Button A is kept in and not released, LED A must still only stay ON for 4 seconds.
4. If Switch B is ON, LED B must be ON; if Switch B is OFF, LED B must be OFF.

5. The system can be in one of 2 states: NORMAL (0) – the default state that the system starts
up in; ESTOP (1) – the emergency state that is started when Button B is pressed; use the
InterruptIn API

6. When the system is in the ESTOP state, it can only be returned to the NORMAL state when
LED A goes ON (after Button A is pressed for longer than 1 second).
7. The Status LED must be controlled as follows (use the Ticker API):
a. Flash at a rate of 1 sec ON and 1 sec OFF in NORMAL mode
b. Flash at a rate of 100mS ON and 100mS OFF in ESTOP state

SPECIAL NOTE:
You can ignore the warnings created by Mbed Studio for the following methods for the

Timer: , and the Ticker, and Timeout APIs:


These are methods that will be phased out in future (deprecated), but still works for now.

The practical test will be evaluated using the following marking rubric:
Section: Criteria: Multiplier:
0 1 2 4

Compile and run Does not compile and Small change needed to Compiles, but no x1
Compiles and runs
run at all compile outputs/inputs working

0 +1 +1 +1
Holding button for longer
Button A Correct button hold time than 1 second DOES x2
Not implemented Used Timer API for button hold time determination
implemented NOT cause extra delay
before LED A turns off.
0 +1 +1 +1 +1

LED A Correct delay before x2


Not implemented Turns on Turns off Used Timeout API
turning off

0 +1 +1 +1

LED B SW B on turns LED B SW B off turns LED B x2


Not implemented LED B off in ESTOP state
on in NORMAL state off in NORMAL state

0 +1 +1 +1

Button B Button B causes ESTOP LED A resets state to x2


Not implemented Used InterruptIn API for Button B
state NORMAL again

0 +1 +1 +1 +1
Flashes at 100mS Flashes at 1 sec
Status LED control Flashes at 1 sec x2
Not implemented intervals during ESTOP intervals again after Used Ticker API
intervals in normal state
state ESTOP state is resetted
Program code 0 (1 OR 2) + (1 OR 2)
layout and Poor layout; poor x1
Average code layout Good code layout Average commenting Good commenting
indentation commenting
Total: 42
GA Assessment:
GA 2: Application of scientific and engineering knowledge No, needs improvement Yes

You might also like