disabled accelerometer (use past commit for this script to work for app)
This commit is contained in:
@@ -10,7 +10,14 @@ unsigned long lastTime = 0; // will store the last time the code was run
|
||||
|
||||
void loop() {
|
||||
SensorManager::eulerAngles eulerRotation = sensorManager.getEulerAngles();
|
||||
SensorManager::acceleration rotationAcceleration = sensorManager.getAcelleration();
|
||||
// SensorManager::acceleration rotationAcceleration = sensorManager.getAcelleration();
|
||||
|
||||
|
||||
struct acceleration {
|
||||
float x = 9;
|
||||
float y = 9;
|
||||
float z = 9;
|
||||
} accelData;
|
||||
|
||||
unsigned long currentTime = millis();
|
||||
if (currentTime - lastTime >= 100) { // 100 ms has passed
|
||||
@@ -22,12 +29,12 @@ void loop() {
|
||||
eulerRotation.roll,
|
||||
eulerRotation.pitch,
|
||||
eulerRotation.yaw,
|
||||
rotationAcceleration.x,
|
||||
rotationAcceleration.y,
|
||||
rotationAcceleration.z,
|
||||
accelData.x,
|
||||
accelData.y,
|
||||
accelData.z,
|
||||
"data");
|
||||
// %d = int, %f = floatation, %s = string
|
||||
connectivity.httpPost("192.168.137.45", "/", 3445, buffer, strlen(buffer), "application/json");
|
||||
connectivity.httpPost("192.168.137.243", "/", 3445, buffer, strlen(buffer), "application/json");
|
||||
lastTime = currentTime;
|
||||
}
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@ void SensorManager::sensorSetup() {
|
||||
//start sensorfunction and start autocalibration
|
||||
//once calibration is enabled it attempts to every 5 min
|
||||
myIMU.enableGyroIntegratedRotationVector(100); //send data every 100ms
|
||||
myIMU.enableAccelerometer(100); //Send data update every 100ms
|
||||
// myIMU.enableAccelerometer(100); //Send data update every 100ms
|
||||
// myIMU.enableStepCounter(500); //Send data update every 500ms
|
||||
}
|
||||
//get sensordata
|
||||
|
Reference in New Issue
Block a user