Exemple #1
0
void setupAccel(){
	if(!accel.begin()){
		Serial.println("Failed to init sensor");
	}

	else accel.setRange(ADXL345_RANGE_4_G);
}
Exemple #2
0
void GY80Task::setupADXL345()
{
	/* Initialise the sensor */
	if (!accel.begin())
	{
		/* There was a problem detecting the ADXL345 ... check your connections */
		LogUtils::instance()->logTrace(LogUtils::error, "Ooops, no ADXL345 detected ... Check your wiring!");
		while (1);
	}

	/* Set the range to whatever is appropriate for your project */
	accel.setRange(ADXL345_RANGE_16_G);
}