summaryrefslogtreecommitdiff
path: root/CODE/debugprewk/debug/IMU_comp/Calibrate/Calibrate.ino
diff options
context:
space:
mode:
authorAbel Tim <abel.tim.t@gmail.com>2025-03-23 12:38:48 +0100
committerAbel Tim <abel.tim.t@gmail.com>2025-03-23 12:38:48 +0100
commit764c8722596f5b3bd01bb26848f7289b0972d7b0 (patch)
tree73b8090d371b0c0479f1b72803f3e0e0f0754dc1 /CODE/debugprewk/debug/IMU_comp/Calibrate/Calibrate.ino
parenta52c13fdf50fbc19dfdce2d087b4739b96d46a0b (diff)
downloadrobotica-764c8722596f5b3bd01bb26848f7289b0972d7b0.tar.gz
robotica-764c8722596f5b3bd01bb26848f7289b0972d7b0.zip
updated repo structure
Diffstat (limited to 'CODE/debugprewk/debug/IMU_comp/Calibrate/Calibrate.ino')
-rw-r--r--CODE/debugprewk/debug/IMU_comp/Calibrate/Calibrate.ino42
1 files changed, 0 insertions, 42 deletions
diff --git a/CODE/debugprewk/debug/IMU_comp/Calibrate/Calibrate.ino b/CODE/debugprewk/debug/IMU_comp/Calibrate/Calibrate.ino
deleted file mode 100644
index c5db31c..0000000
--- a/CODE/debugprewk/debug/IMU_comp/Calibrate/Calibrate.ino
+++ /dev/null
@@ -1,42 +0,0 @@
-//example from https://github.com/pololu/lis3mdl-arduino
-#include <Wire.h>
-#include <LIS3MDL.h>
-
-LIS3MDL mag;
-LIS3MDL::vector<int16_t> running_min = {32767, 32767, 32767}, running_max = {-32768, -32768, -32768};
-
-char report[80];
-
-void setup()
-{
- Serial.begin(9600);
- Wire.begin();
-
- if (!mag.init())
- {
- Serial.println("Failed to detect and initialize magnetometer!");
- while (1);
- }
-
- mag.enableDefault();
-}
-
-void loop()
-{
- mag.read();
-
- running_min.x = min(running_min.x, mag.m.x);
- running_min.y = min(running_min.y, mag.m.y);
- running_min.z = min(running_min.z, mag.m.z);
-
- running_max.x = max(running_max.x, mag.m.x);
- running_max.y = max(running_max.y, mag.m.y);
- running_max.z = max(running_max.z, mag.m.z);
-
- snprintf(report, sizeof(report), "min: {%+6d, %+6d, %+6d} max: {%+6d, %+6d, %+6d}",
- running_min.x, running_min.y, running_min.z,
- running_max.x, running_max.y, running_max.z);
- Serial.println(report);
-
- delay(100);
-}