🐛 Imu temp in message
This commit is contained in:
committed by
Niklas Jensen
parent
5c4dc51093
commit
042548412d
@@ -16,7 +16,7 @@ export const imu = (() => {
|
|||||||
|
|
||||||
const addData = (content: IMUMsg) => {
|
const addData = (content: IMUMsg) => {
|
||||||
update(data => {
|
update(data => {
|
||||||
if (content.imu && content.imu[3]) {
|
if (content.imu && content.imu[4]) {
|
||||||
data.x = [...data.x, content.imu[0]].slice(-maxIMUData)
|
data.x = [...data.x, content.imu[0]].slice(-maxIMUData)
|
||||||
data.y = [...data.y, content.imu[1]].slice(-maxIMUData)
|
data.y = [...data.y, content.imu[1]].slice(-maxIMUData)
|
||||||
data.z = [...data.z, content.imu[2]].slice(-maxIMUData)
|
data.z = [...data.z, content.imu[2]].slice(-maxIMUData)
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ export type IMU = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type IMUMsg = {
|
export type IMUMsg = {
|
||||||
imu: [number, number, number, boolean]
|
imu: [number, number, number, number, boolean]
|
||||||
mag: [number, number, number, number, boolean]
|
mag: [number, number, number, number, boolean]
|
||||||
bmp: [number, number, number, boolean]
|
bmp: [number, number, number, boolean]
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -185,7 +185,7 @@ void IRAM_ATTR SpotControlLoopEntry(void *) {
|
|||||||
#if FT_ENABLED(USE_WS2812)
|
#if FT_ENABLED(USE_WS2812)
|
||||||
ledService.loop();
|
ledService.loop();
|
||||||
#endif
|
#endif
|
||||||
EXECUTE_EVERY_N_MS(250, [&]() {
|
EXECUTE_EVERY_N_MS(250, {
|
||||||
JsonDocument doc;
|
JsonDocument doc;
|
||||||
JsonVariant results = doc.to<JsonVariant>();
|
JsonVariant results = doc.to<JsonVariant>();
|
||||||
peripherals.getIMUResult(results);
|
peripherals.getIMUResult(results);
|
||||||
|
|||||||
Reference in New Issue
Block a user