GPS and accelero in the same time
Posted: Fri Jul 08, 2016 9:10 am
by thomas110594
Hi !
Can we use the GPS and the accelerometer in the same time? Because, I'm always forced to stop the accelerometer when I want the localisation and when I start the accelerometer, the GPS stops.
Do you have any explanation about this?
Thank you.
Re: GPS and accelero in the same time
Posted: Fri Jul 08, 2016 9:27 am
by lcheminade
Hi,
This should work fine if you call the geloc_init and accelero_init only once at startup. They both share the same SPI bus so it is sometimes tricky to get them to live together. Are you on TD1204 or TD1205? Could you share some piece of code please?
Regards.
Re: GPS and accelero in the same time
Posted: Fri Jul 08, 2016 10:09 am
by thomas110594
Yes I call the geloc_init and accelero_init only once at the TD_USER_Setup function.
void TD_USER_Setup(void)
{
TD_UART_Options_t options = {LEUART_DEVICE, LEUART_LOCATION, 9600, 8, 'N',
1, false};
// Open an I/O stream using LEUART0
TD_UART_Open(&options, TD_STREAM_RDWR);
// Set flash variables version
TD_FLASH_DeleteVariables();
// Set the device as a Sensor transmitter
TD_SENSOR_Init(SENSOR_TRANSMITTER, 0, 0);
// Geoloc and accelerometer initialization
TD_GEOLOC_Init();
TD_ACCELERO_Init();
// Start GPS forever
TD_GEOLOC_TryToFix(TD_GEOLOC_NAVIGATION, TD_GEOLOC_INFINITE, GPSFix);
// Monitor accelerometer data-
TD_ACCELERO_MonitorData(true,
true,
TD_ACCELERO_50HZ,
TD_ACCELERO_ALL_AXIS,
TD_ACCELERO_8G,
0,
TD_ACCELERO_STREAMFIFO,
31,
DataCallback);
}
Like this it doesn't work... In the respective callback function, I just print some value.