Overview

The goal of this lab is to introduce you to the basics of the GPIO (general purpose input/output) and serial communication modules of Mbed OS. You will implement a basic four function calculator using a 4x4 matrix membrane keypad as an input, and the serial terminal as the output.

This lab is to be completed individually, but you may consult with others if you are stuck (see the Collaboration Policy in the course syllabus).

Required Materials

Calculator Design Requirements

Calculation

The calculator should be able to perform addition, subtraction, multiplication, and division of two integers, with the result returned as a float i.e. including fractions.

Associated functions:

float computation(int num1, int num2, char operation);

Keypad

Screen Shot 2023-01-18 at 10.54.06 AM.png

The numbers 0–9 on the keypad should be used to enter each of the two integers, with a function pressed in between. The letters A–D should correspond to the four functions as follows:

The * key should be used to indicate that the integer is negative i.e. to type -15, the user would type *,1,5.