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() {
|
void loop() {
|
||||||
SensorManager::eulerAngles eulerRotation = sensorManager.getEulerAngles();
|
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();
|
unsigned long currentTime = millis();
|
||||||
if (currentTime - lastTime >= 100) { // 100 ms has passed
|
if (currentTime - lastTime >= 100) { // 100 ms has passed
|
||||||
@@ -22,12 +29,12 @@ void loop() {
|
|||||||
eulerRotation.roll,
|
eulerRotation.roll,
|
||||||
eulerRotation.pitch,
|
eulerRotation.pitch,
|
||||||
eulerRotation.yaw,
|
eulerRotation.yaw,
|
||||||
rotationAcceleration.x,
|
accelData.x,
|
||||||
rotationAcceleration.y,
|
accelData.y,
|
||||||
rotationAcceleration.z,
|
accelData.z,
|
||||||
"data");
|
"data");
|
||||||
// %d = int, %f = floatation, %s = string
|
// %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;
|
lastTime = currentTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@ void SensorManager::sensorSetup() {
|
|||||||
//start sensorfunction and start autocalibration
|
//start sensorfunction and start autocalibration
|
||||||
//once calibration is enabled it attempts to every 5 min
|
//once calibration is enabled it attempts to every 5 min
|
||||||
myIMU.enableGyroIntegratedRotationVector(100); //send data every 100ms
|
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
|
// myIMU.enableStepCounter(500); //Send data update every 500ms
|
||||||
}
|
}
|
||||||
//get sensordata
|
//get sensordata
|
||||||
|
Reference in New Issue
Block a user