Code Structure
This code uses a Finite State Machine (FSM) scheme for its structure. It is implemented using the cotask and task_share modules provided from https://spluttflob.github.io/ME405-Support/index.html#ss_modules
Task Diagram
To give an overview of this structure, here is a Task Diagram:
State Transition Diagrams
To give a little more detail into each task, here are State Transition Diagrams for each task labelled in the Task Diagram.