Hello,
I would like to read raw data from accelerometer, when an event is coming.
I wrote this function, which is a callback from the move:
void MoveDetected(uint8_t source)
{
tfp_printf("move detected\r\n");
TD_ACCELERO_MonitorEvent(false, // Monitoring enabled
TD_ACCELERO_1HZ, // Sampling rate 10 Hz
TD_ACCELERO_ALL_AXIS, // Axis mask: all axis
TD_ACCELERO_2G, // Scale 2 g
TD_ACCELERO_ALL_HIGH_IRQ, // Only monitor high IRQs, as low IRQs are always set in
// accelerometer registers
10, // Threshold in mg = 10 * 2 g / 127 = +- 160 mg (with scale 2 g)
1, // Duration in ms = 1 * (1 / 10 Hz) = 100 ms (with rate 10 Hz)
1, // High-pass filter enabled
MoveDetected);
TD_ACCELERO_MonitorData(true, // Monitoring enabled
false, // Low-power mode disabled
TD_ACCELERO_1HZ, // Sampling rate 1 Hz
TD_ACCELERO_ALL_AXIS, // Axis mask: all axis
TD_ACCELERO_2G, // Scale 2 g
0, // High-pass filter disabled
TD_ACCELERO_STREAM, // FIFO stream mode
ACCELERO_AVERAGE_SAMPLE, // Update watermark disabled (32 max, 0 is real-time)
DataCallback);
}
The problem is if the Datacallback gives great results if configured directly from the setup, it gives high pass filtered results on x an y axis only (?), when TD_ACCELERO_MonitorEvent is only called here.
I also don't know if both MonitorEvent and MonitorData ca work at the same time, and so if I must switch one off when I want to use the other one.
Thank you for your help.