mirror of
https://github.com/okalachev/flix.git
synced 2025-07-27 17:49:33 +00:00
Some minor cleanups and fixes
This commit is contained in:
parent
7ae5457bb4
commit
e10475a5e0
@ -121,9 +121,9 @@ void calibrateAccelOnce() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void printIMUCal() {
|
void printIMUCal() {
|
||||||
Serial.printf("gyro bias: %f, %f, %f\n", gyroBias.x, gyroBias.y, gyroBias.z);
|
Serial.printf("gyro bias: %f %f %f\n", gyroBias.x, gyroBias.y, gyroBias.z);
|
||||||
Serial.printf("accel bias: %f, %f, %f\n", accBias.x, accBias.y, accBias.z);
|
Serial.printf("accel bias: %f %f %f\n", accBias.x, accBias.y, accBias.z);
|
||||||
Serial.printf("accel scale: %f, %f, %f\n", accScale.x, accScale.y, accScale.z);
|
Serial.printf("accel scale: %f %f %f\n", accScale.x, accScale.y, accScale.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
void printIMUInfo() {
|
void printIMUInfo() {
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
#pragma once
|
// Copyright (c) 2024 Oleg Kalachev <okalachev@gmail.com>
|
||||||
|
// Repository: https://github.com/okalachev/flix
|
||||||
|
|
||||||
|
// Parameters storage in flash memory
|
||||||
|
|
||||||
#include <Preferences.h>
|
#include <Preferences.h>
|
||||||
|
|
||||||
@ -67,7 +70,6 @@ void setupParameters() {
|
|||||||
// Read parameters from storage
|
// Read parameters from storage
|
||||||
for (auto ¶meter : parameters) {
|
for (auto ¶meter : parameters) {
|
||||||
if (!storage.isKey(parameter.name)) {
|
if (!storage.isKey(parameter.name)) {
|
||||||
Serial.printf("Define new parameter %s = %f\n", parameter.name, *parameter.variable);
|
|
||||||
storage.putFloat(parameter.name, *parameter.variable);
|
storage.putFloat(parameter.name, *parameter.variable);
|
||||||
}
|
}
|
||||||
*parameter.variable = storage.getFloat(parameter.name, *parameter.variable);
|
*parameter.variable = storage.getFloat(parameter.name, *parameter.variable);
|
||||||
|
@ -29,8 +29,7 @@ float wrapAngle(float angle) {
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void printArray(T arr[], int size) {
|
void printArray(T arr[], int size) {
|
||||||
for (uint8_t i = 0; i < size; i++) {
|
for (uint8_t i = 0; i < size; i++) {
|
||||||
Serial.printf("%g", static_cast<float>(arr[i]));
|
Serial.printf("%g ", static_cast<float>(arr[i]));
|
||||||
if (i < size - 1) Serial.print(" ");
|
|
||||||
}
|
}
|
||||||
Serial.println();
|
Serial.println();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user