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: MPU9250_SPI
Fork of WearableDevice_Nucleo by
event.cpp
- Committer:
- Muglug
- Date:
- 2017-11-08
- Revision:
- 26:4bc56ce08d15
- Parent:
- 25:86137c182a17
- Child:
- 27:c4b2ce6fa5b8
File content as of revision 26:4bc56ce08d15:
/*
* Los Putacos
* Copyright (C) 2017, All rights reserved.
* ________________________________________
*
* Created by: Gustavo Campana, Michael Schmidt, Miguel Lopez
* Date: 12-Oct-2017
* Version: V0.1
*/
//-----------------------------------------------------------------
//-----------------------------------------------------------------
// Includes
#include "event.h"
//-----------------------------------------------------------------
//-----------------------------------------------------------------
void ReceiveXBee(void)
{
XBee.process_rx_frames(); // Check for Received Frames
}
//-----------------------------------------------------------------
//-----------------------------------------------------------------
void ReadIMU(void)
{
Time_Data = TimeStamp.read_ms(); // Read TimeStamp Data
if (Time_Data <= Requested_Time * 1000) { // Check Time Elapsed
imu.read_all();
Data_Storage_MIC[writePointer_MIC++] = micro.read_u16(); // Store Microphone Data
Data_Storage[writePointer++] = (int)(1000*imu.accelerometer_data[2]); // Store Z-Axis Accelerometer Data
Data_Storage[writePointer++] = (int)(1000*imu.accelerometer_data[1]); // Store Y-Axis Accelerometer Data
Data_Storage[writePointer++] = (int)(1000*imu.accelerometer_data[0]); // Store X-Axis Accelerometer Data
Data_Storage[writePointer++] = Time_Data; // Store Time Data
} else {
Ticker_IMU.detach(); // Detach Timer to Stop "ReadIMU"
TimeStamp.stop(); // Stop TimeStamp
ReadIMU_Flag = 1;
PC.printf(" Done!\n");
PC.printf("Writing SD-Card ...");
}
}
//-----------------------------------------------------------------
//-----------------------------------------------------------------
