kh
Dependencies: mbed PinDetect Servo
main.cpp
- Committer:
- Sayak97
- Date:
- 2018-11-10
- Revision:
- 0:28e05e1a3d1e
- Child:
- 1:2c365f6da61d
File content as of revision 0:28e05e1a3d1e:
/* * Authors: Group 4 Adam Elghor, Brian Kaplan, Sayak Chatterjee, Moraa Onwonga * Purpose: Controls the functions of the safe * Language: C */ #include "open.h" #include "lock.h" #include "setup.h" #include "sleep.h" #include "parameters.h" task main() { SafeStateMachine(); } /* * Function: SafeStateMachine * -------------------- * Routine for the safe's basic functions. * * * */ void SafeStateMachine() { enum states state = SETUP; while (1) { switch (state) { case OPEN:/*state in which the the case is open*/ state = open(); break; case LOCK:/*state in which the case us closed*/ state = lock(); break; case SETUP:/*state in which the the case is changing its settings*/ state = setup(); break; default: state = locked(); } } }