void DataReceivedEventHandler(int active_channels)
{
float percent_complete;
if (data_collection_enabled)
{
// Get the yaw, pitch, and roll angle of the most recently logged data.
// Determine whether the angle is sufficiently different to justify logging it.
// If so, log it. Update the data collection progress bars as neccessary.
//if (isUniqueVector(sensor.gyroX, sensor.gyroY, sensor.gyroZ))
int certo = 1;
if(certo==1)
{
loggedData[next_data_index, 0] = sensor.gyroX;
loggedData[next_data_index, 1] = sensor.gyroY;
loggedData[next_data_index, 2] = sensor.gyroZ;
next_data_index++;
if (next_data_index == SAMPLES)
{
data_collection_enabled = false;
percent_complete = 100;
displayLoggingPercent(percent_complete);
}
else
{
// Update data collection bar
percent_complete = ((float)dataProgressBar.Maximum / (float)SAMPLES) * (float)next_data_index;
displayLoggingPercent(percent_complete);
}
}
}
}