Gyro in gps module?

I’am playing with the gps module and I noticed that it has a gyro/accel but I can’t find any docs nor samples about that. Am I wrong about that feature?

Which GPS module? The one in the Carloop store?

Ublox SAM-M8Q-0-10?

Yes, the carloop gps (ublox sam m8q 0 10).

Do you have some code?

Carloop’s library (the GPS part) is built on top of the TinyGPS++ but I haven’t found a specific function to retrieve the values from the gyroscope and accel.

My guess is that it doesn’t have that kind of functions and it has to be done writing some code.

Maybe nobody have tested the gyro and accel by the moment. It would be nice if somebody does it.

The product description mention that has a 3 axis accelerometer… But would be nice to see a simple example about the feature.

I was doing some reverse engeneering “by eye” from the breakout, and I see that in fact, the device has a LIS3DH device (as the product description mention) and I’m trying to get some info from the LIS3DH using the library provided in particle build online ide, but nothing is workin.

If some of you guys get working a code, would be nice to complement the samples with working code.

Yes, that would be nice. Will try to find one example.

Currently I was seeing the schematics and the “legends on the GPS board” (yes, we have to see also the labels in the board) and I now has a sample:

#include "Particle.h"

#include "LIS3DH.h"

// Example using position detection feature of the LIS3DH and SPI connection, like the AssetTracker

SYSTEM_THREAD(ENABLED);

const unsigned long PRINT_SAMPLE_PERIOD = 100;

void positionInterruptHandler();

// LIS3DH is connected as in the AssetTracker, to the primary SPI with A2 as the CS (SS) pin, and INT connected to WKP
LIS3DHSPI accel(SPI, D5, WKP);

unsigned long lastPrintSample = 0;

volatile bool positionInterrupt = false;
uint8_t lastPos = 0;

void setup() {
	Serial.begin(9600);

	attachInterrupt(WKP, positionInterruptHandler, RISING);

	delay(5000);

	// Initialize sensors
	LIS3DHConfig config;
	config.setPositionInterrupt(16);

	bool setupSuccess = accel.setup(config);
	Serial.printlnf("setupSuccess=%d", setupSuccess);
}

void loop() {
	LIS3DHSample sample;

	if (millis() - lastPrintSample >= PRINT_SAMPLE_PERIOD) {
		lastPrintSample = millis();
		if (accel.getSample(sample)) {
			Serial.printlnf("%d,%d,%d", sample.x, sample.y, sample.z);
		}
		else {
			Serial.println("no sample");
		}
	}
	if (positionInterrupt) {
		positionInterrupt = false;

		// Test the position interrupt support. Normal result is 5.
		// 5: normal position, with the accerometer facing up
		// 4: upside down
		// 1 - 3: other orientations
		uint8_t pos = accel.readPositionInterrupt();
		if (pos != 0 && pos != lastPos) {
			Serial.printlnf("pos=%d", pos);
			lastPos = pos;
		}
	}
}

void positionInterruptHandler() {
	positionInterrupt = true;
}

It’s important to be aware that the D5 pin is de CS pin for the LID3DH and the A2 is the CS pin for the SD slot.

Now I have to parse the received data.

Hope it helps

Thanks for the example, will try it out.