kh

Dependencies:   mbed PinDetect Servo

actuators.cpp

Committer:
Sayak97
Date:
10 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 actuators of the safe
* Language:  NBC
*/
#include "actuators.h"
#include "parameters.h"
#include "mbed.h"


PwmOut rcServo1(p23); // pwm, fwd, rev
PwmOut rcServo2(p24); // pwm, fwd, rev

/*
* Function:  turnsRcServosRight
* --------------------
*  Turns the servos to the right
*
*
*/
void turnsRcServosRight() {
	rcServo1 = 1.0f;
	rcServo2 = 1.0f;
}

/*
* Function:  urnsRcServosLeft
* --------------------
*  Turns the servos to the right
*
*
*/
void turnsRcServosLeft() {
	rcServo1 = -1.0f;
	rcServo2 = -1.0f;
}


/*
* Function:  openSafe
* --------------------
*  Opens the safe
*/
void openSafe() {
	turnsRcServosRight();
}

/*
* Function:  lockSafe
* --------------------
*  Locks the safe
*/
void lockSafe() {
	turnsRcServosLeft();
}