SRVCTL - Sets period required to handle a servo motor, - Provides a APIs to move the servo motor in order to change car direction.

Dependents:   frdm_MasterVehicle

Committer:
JalilChavez
Date:
Fri Oct 17 21:47:57 2014 +0000
Revision:
1:b76be70801ed
Parent:
0:b0455b6a805a
- Added internal accelerometer support.; - Code commented.; - Included Rx and Tx buffers.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JalilChavez 0:b0455b6a805a 1 #ifndef _SRVCTL_H_
JalilChavez 0:b0455b6a805a 2 #define _SRVCTL_H_
JalilChavez 0:b0455b6a805a 3
JalilChavez 0:b0455b6a805a 4 #include "mbed.h"
JalilChavez 0:b0455b6a805a 5
JalilChavez 0:b0455b6a805a 6 /**********************************************************************************
JalilChavez 0:b0455b6a805a 7 * Servo parameters
JalilChavez 0:b0455b6a805a 8 ***********************************************************************************/
JalilChavez 0:b0455b6a805a 9 #define START_POS 1700/* us
JalilChavez 0:b0455b6a805a 10 * Description: Minimum position of servo motor
JalilChavez 0:b0455b6a805a 11 */
JalilChavez 0:b0455b6a805a 12
JalilChavez 1:b76be70801ed 13 #define FINAL_POS 2400/* us
JalilChavez 0:b0455b6a805a 14 * Description: Maximum position of servo motor
JalilChavez 0:b0455b6a805a 15 */
JalilChavez 0:b0455b6a805a 16
JalilChavez 0:b0455b6a805a 17 #define MIDDLE_POINT ( FINAL_POS - START_POS )/2/*
JalilChavez 0:b0455b6a805a 18 * Description: Middle point of servo motor
JalilChavez 0:b0455b6a805a 19 */
JalilChavez 0:b0455b6a805a 20
JalilChavez 0:b0455b6a805a 21 #define SERVO_PERIOD 20/* ms
JalilChavez 0:b0455b6a805a 22 * Description: Period required to move servo motor
JalilChavez 0:b0455b6a805a 23 */
JalilChavez 0:b0455b6a805a 24
JalilChavez 0:b0455b6a805a 25 /**********************************************************************************
JalilChavez 0:b0455b6a805a 26 * Variable types definition
JalilChavez 0:b0455b6a805a 27 ***********************************************************************************/
JalilChavez 0:b0455b6a805a 28
JalilChavez 0:b0455b6a805a 29 /**********************************************************************************
JalilChavez 0:b0455b6a805a 30 * Global functions
JalilChavez 0:b0455b6a805a 31 ***********************************************************************************/
JalilChavez 0:b0455b6a805a 32 void SRVCTL_vInit(void);
JalilChavez 0:b0455b6a805a 33 void SRVCTL_vSetPosition( uint16_t u16PosVal, const uint16_t u16MaxVal );
JalilChavez 0:b0455b6a805a 34
JalilChavez 0:b0455b6a805a 35 #endif