Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed DCM_AHRS_GY80 PID MMA8451Q
Fork of quadCommand by
Diff: quadCommand/sensorS/sensors.cpp
- Revision:
- 35:2367d7923302
- Parent:
- 22:2aa22b4f49d6
- Child:
- 37:8114f9c7c40b
diff -r 87d325eab299 -r 2367d7923302 quadCommand/sensorS/sensors.cpp
--- a/quadCommand/sensorS/sensors.cpp Mon Jun 10 00:30:52 2013 +0000
+++ b/quadCommand/sensorS/sensors.cpp Mon Jun 10 00:40:45 2013 +0000
@@ -9,8 +9,10 @@
sensors::sensors()
{
+ Ticker sensorProcess;
+
acc = new MMA8451Q( ACCSDA, ACCSCL, MMA8451_I2C_ADDRESS);
- //sensorProcess.attach( this, &com::callback );motorProcess.attach(&quad, &quadCommand::updateMotors, quadCommand::MOTOR_UPDATE/1000.0f);
+ sensorProcess.attach( this, &sensors::sendData, 2 );
}
/************************** getAbsoluteX() *******************************/
@@ -33,6 +35,10 @@
return acc->getAccY();
}
+/**************************** sendData() *********************************/
+/* */
+/*************************************************************************/
+
void sensors::sendData()
{
