kh

Dependencies:   mbed PinDetect Servo

setup.cpp

Committer:
Sayak97
Date:
4 months ago
Revision:
1:2c365f6da61d
Parent:
0:28e05e1a3d1e
Child:
2:04bbd14722bd

File content as of revision 1:2c365f6da61d:

/*
* Authors: Group 4 Adam Elghor, Brian Kaplan, Sayak Chatterjee, Moraa Onwonga
* Purpose: Controls the SETUP state of the machine
* Language: C
*/
#include "setup.h"
#include "authentication.h"
#include "parameters.h"
#include "actuators.h"


DigitalIn button(p8);

/*
* Function:  setup
* --------------------
*  Calls the functions needed to setup the entry sequence for the safe.
*
*  returns: the next state in the state machine
*  LOCK: after entry sequence has been entered
*
*/


enum states setup() {
	if(button) {
	setEntrySequenceAttempt();
	wait(5000);
	lockSafe();
	wait(5000);
	return LOCK;
	}
	return SETUP;
}