Prosper Van / Mbed 2 deprecated quadCommand2

Dependencies:   mbed DCM_AHRS_GY80 PID MMA8451Q

Fork of quadCommand by Greg Abdo

quadCommand/sensorS/sensors.cpp

Committer:
gabdo
Date:
2013-06-10
Revision:
35:2367d7923302
Parent:
22:2aa22b4f49d6
Child:
37:8114f9c7c40b

File content as of revision 35:2367d7923302:

/************************ quadCommand.cpp ********************************/
/*                                                                       */
/*************************************************************************/
#include "sensors.h"

/***************************** sensors() *********************************/
/*                                                                       */
/*************************************************************************/

sensors::sensors()
{
     Ticker sensorProcess;
     
     acc = new MMA8451Q( ACCSDA, ACCSCL, MMA8451_I2C_ADDRESS);
     sensorProcess.attach( this, &sensors::sendData, 2 );
}

/************************** getAbsoluteX() *******************************/
/* Returns a float from -1 to 1 for the value off level in the x         */
/*directoin. 0 = level.                                                  */
/*************************************************************************/

float sensors::getAbsoluteX()
{
    return acc->getAccX();
} 

/************************** getAbsoluteY() *******************************/
/* Returns a float from -1 to 1 for the value off level in the Y         */
/*directoin. 0 = level.                                                  */
/*************************************************************************/

float sensors::getAbsoluteY()
{
    return acc->getAccY();
} 

/**************************** sendData() *********************************/
/*                                                                       */
/*************************************************************************/

void sensors::sendData()
{

}