Hi all,
in order to convert adc data to something meanfull you can use teh following. However, you have to calibrate the accelerometer... The result is in mg.
float convert_accelx(uint16_t accel_raw)
{
uint16_t AccelData;
uint16_t calib_neg_1g = X_NEG_1G; //451
uint16_t calib_pos_1g = X_POS_1G; // 568
float scale_factor;
float reading;
//printf("valor x rebut %u\r\n", accel_raw);
AccelData = accel_raw;
scale_factor = ( calib_pos_1g - calib_neg_1g ) / 2;
reading = 1.0 - (calib_pos_1g - AccelData) / scale_factor;
reading = reading * 1000.0;
return reading;
}
_______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
