kh
Dependencies: mbed PinDetect Servo
main.cpp
- Committer:
- Sayak97
- Date:
- 2018-11-12
- Revision:
- 2:04bbd14722bd
- Parent:
- 1:2c365f6da61d
- Child:
- 3:2f7a7e2cd49e
File content as of revision 2:04bbd14722bd:
/* * 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 "parameters.h" #include "authentication.h" enum states state = SETUP; /* * Function: SafeStateMachine * -------------------- * Routine for the safe's basic functions. * * * */ void SafeStateMachine() { 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 = lock(); } wait(.5); } } int main() { start_bluetooth(); SafeStateMachine(); }