From 3e119a26f68c4697b4f885f1721d55b9d1cc5ac5 Mon Sep 17 00:00:00 2001 From: Abhiram Saridena Date: Thu, 9 Feb 2023 19:26:51 -0500 Subject: [PATCH 01/49] Added imu i2c code --- src/imu_i2c.ino | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/imu_i2c.ino diff --git a/src/imu_i2c.ino b/src/imu_i2c.ino new file mode 100644 index 0000000..ae39ca1 --- /dev/null +++ b/src/imu_i2c.ino @@ -0,0 +1,50 @@ +#include +#include +// Basic demo for accelerometer & gyro readings from Adafruit +// LSM6DSOX sensor + +#include + +Adafruit_LSM6DSOX imu = Adafruit_LSM6DSOX(); + +// For SPI mode, we need a CS pin +#define LSM_CS 10 +// For software-SPI mode we need SCK/MOSI/MISO pins +#define LSM_SCK 13 +#define LSM_MISO 12 +#define LSM_MOSI 11 + +void setup(void) { + Wire.begin(); + imu.begin_I2C(); +} + +void loop() { + sensors_event_t a, g, temp; + imu.getEvent(&a, &g, &temp); + + // Use the readings as needed. + float x_accel = a.acceleration.x; + float y_accel = a.acceleration.y; + float z_accel = a.acceleration.z; + Serial.print("Accelerometer data: X="); + Serial.print(x_accel); + Serial.print(" Y="); + Serial.print(y_accel); + Serial.print(" Z="); + Serial.println(z_accel); + + float x_gyro = g.gyro.x; + float y_gyro = g.gyro.y; + float z_gyro = g.gyro.z; + Serial.print("Gyroscope data: X="); + Serial.print(x_gyro); + Serial.print(" Y="); + Serial.print(y_gyro); + Serial.print(" Z="); + Serial.println(z_gyro); + + delay(100); + + // Do something with the readings... +} \ No newline at end of file From 631fe85086033bcb35dfe7146429ba6e1aea797e Mon Sep 17 00:00:00 2001 From: Abhiram Saridena <89488593+asaridena@users.noreply.github.com> Date: Thu, 9 Feb 2023 23:50:05 -0500 Subject: [PATCH 02/49] Delete imu_i2c.ino --- src/imu_i2c.ino | 50 ------------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 src/imu_i2c.ino diff --git a/src/imu_i2c.ino b/src/imu_i2c.ino deleted file mode 100644 index ae39ca1..0000000 --- a/src/imu_i2c.ino +++ /dev/null @@ -1,50 +0,0 @@ -#include -#include -// Basic demo for accelerometer & gyro readings from Adafruit -// LSM6DSOX sensor - -#include - -Adafruit_LSM6DSOX imu = Adafruit_LSM6DSOX(); - -// For SPI mode, we need a CS pin -#define LSM_CS 10 -// For software-SPI mode we need SCK/MOSI/MISO pins -#define LSM_SCK 13 -#define LSM_MISO 12 -#define LSM_MOSI 11 - -void setup(void) { - Wire.begin(); - imu.begin_I2C(); -} - -void loop() { - sensors_event_t a, g, temp; - imu.getEvent(&a, &g, &temp); - - // Use the readings as needed. - float x_accel = a.acceleration.x; - float y_accel = a.acceleration.y; - float z_accel = a.acceleration.z; - Serial.print("Accelerometer data: X="); - Serial.print(x_accel); - Serial.print(" Y="); - Serial.print(y_accel); - Serial.print(" Z="); - Serial.println(z_accel); - - float x_gyro = g.gyro.x; - float y_gyro = g.gyro.y; - float z_gyro = g.gyro.z; - Serial.print("Gyroscope data: X="); - Serial.print(x_gyro); - Serial.print(" Y="); - Serial.print(y_gyro); - Serial.print(" Z="); - Serial.println(z_gyro); - - delay(100); - - // Do something with the readings... -} \ No newline at end of file From f046ea1e3868a2a164bb9f186c2a84b4ab81d162 Mon Sep 17 00:00:00 2001 From: Dtech Date: Tue, 8 Aug 2023 22:23:01 -0400 Subject: [PATCH 03/49] Update README.md --- README.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 508ffa0..fb8eabf 100644 --- a/README.md +++ b/README.md @@ -1 +1,31 @@ -# Avionics +# Active Controls Avionics Repository + +Welcome to the AC Avionics Repository! + +This Repo is organized into the following project folders: +ASTRA, Lander, Ground_Station, and DAQ + +## ASTRA + +### /src +### /lib + +## Lander + +### /src +### /lib + +## Ground_Station + +### /src +### /lib + +## DAQ + +### /src +### /lib + + + + + From 5882bad21b3bdecbd6b5b7b9293c4052b6c10906 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 3 Sep 2023 04:27:18 -0400 Subject: [PATCH 04/49] Reorganization and updated ReadMe --- {lib => ASTRA/lib}/HX711-master/.gitignore | 0 {lib => ASTRA/lib}/HX711-master/.travis.yml | 0 {lib => ASTRA/lib}/HX711-master/CMakeLists.txt | 0 {lib => ASTRA/lib}/HX711-master/CONTRIBUTORS.md | 0 {lib => ASTRA/lib}/HX711-master/LICENSE | 0 {lib => ASTRA/lib}/HX711-master/Makefile | 0 {lib => ASTRA/lib}/HX711-master/README.md | 0 {lib => ASTRA/lib}/HX711-master/doc/faq.md | 0 {lib => ASTRA/lib}/HX711-master/doc/notes.md | 0 .../lib}/HX711-master/doc/platformio-howto.md | 0 .../HX711_basic_example/HX711_basic_example.ino | 0 .../HX711_full_example/HX711_full_example.ino | 0 .../HX711_retry_example/HX711_retry_example.ino | 0 .../HX711_timeout_example/HX711_timeout_example.ino | 0 {lib => ASTRA/lib}/HX711-master/keywords.txt | 0 {lib => ASTRA/lib}/HX711-master/library.json | 0 {lib => ASTRA/lib}/HX711-master/library.properties | 0 {lib => ASTRA/lib}/HX711-master/platformio.ini | 0 {lib => ASTRA/lib}/HX711-master/src/HX711.cpp | 0 {lib => ASTRA/lib}/HX711-master/src/HX711.h | 0 {lib => ASTRA/lib}/Servo-master/.codespellrc | 0 .../lib}/Servo-master/.github/dependabot.yml | 0 .../.github/workflows/check-arduino.yml | 0 .../.github/workflows/compile-examples.yml | 0 .../.github/workflows/report-size-deltas.yml | 0 .../Servo-master/.github/workflows/spell-check.yml | 0 .../Servo-master/.github/workflows/sync-labels.yml | 0 {lib => ASTRA/lib}/Servo-master/LICENSE.txt | 0 {lib => ASTRA/lib}/Servo-master/README.adoc | 0 {lib => ASTRA/lib}/Servo-master/docs/api.md | 0 {lib => ASTRA/lib}/Servo-master/docs/readme.md | 0 .../lib}/Servo-master/examples/Knob/Knob.ino | 0 .../Servo-master/examples/Knob/images/knob_BB.png | Bin .../examples/Knob/images/knob_schem.png | Bin .../lib}/Servo-master/examples/Knob/readme.md | 0 .../lib}/Servo-master/examples/Sweep/Sweep.ino | 0 .../Servo-master/examples/Sweep/images/sweep_bb.png | Bin .../examples/Sweep/images/sweep_schem.png | Bin .../lib}/Servo-master/examples/Sweep/readme.md | 0 {lib => ASTRA/lib}/Servo-master/keywords.txt | 0 {lib => ASTRA/lib}/Servo-master/library.properties | 0 {lib => ASTRA/lib}/Servo-master/src/Servo.h | 0 {lib => ASTRA/lib}/Servo-master/src/avr/Servo.cpp | 0 .../lib}/Servo-master/src/avr/ServoTimers.h | 0 {lib => ASTRA/lib}/Servo-master/src/mbed/Servo.cpp | 0 .../lib}/Servo-master/src/mbed/ServoTimers.h | 0 .../lib}/Servo-master/src/megaavr/Servo.cpp | 0 .../lib}/Servo-master/src/megaavr/ServoTimers.h | 0 {lib => ASTRA/lib}/Servo-master/src/nrf52/Servo.cpp | 0 .../lib}/Servo-master/src/nrf52/ServoTimers.h | 0 {lib => ASTRA/lib}/Servo-master/src/sam/Servo.cpp | 0 .../lib}/Servo-master/src/sam/ServoTimers.h | 0 {lib => ASTRA/lib}/Servo-master/src/samd/Servo.cpp | 0 .../lib}/Servo-master/src/samd/ServoTimers.h | 0 .../lib}/Servo-master/src/stm32f4/Servo.cpp | 0 .../lib}/Servo-master/src/stm32f4/ServoTimers.h | 0 .../lib}/TeensyThreads-master/TeensyThreads-asm.S | 0 .../lib}/TeensyThreads-master/TeensyThreads.cpp | 0 .../lib}/TeensyThreads-master/TeensyThreads.h | 0 .../lib}/TeensyThreads-master/TeensyThreads.zip | Bin .../TeensyThreads-master/examples/Blink/Blink.ino | 0 .../examples/Deepsleep/Deepsleep.ino | 0 .../TeensyThreads-master/examples/Print/Print.ino | 0 .../TeensyThreads-master/examples/Runnable/LED.cpp | 0 .../TeensyThreads-master/examples/Runnable/LED.h | 0 .../examples/Runnable/README.txt | 0 .../examples/Runnable/Runnable.h | 0 .../TeensyThreads-master/examples/Runnable/main.ino | 0 .../TeensyThreads-master/examples/Tests/Tests.ino | 0 .../lib}/TeensyThreads-master/keywords.txt | 0 .../lib}/TeensyThreads-master/library.properties | 0 {lib => ASTRA/lib}/TeensyThreads-master/license.txt | 0 {lib => ASTRA/lib}/TeensyThreads-master/readme.md | 0 .../lib}/TeensyTimerTool-master/.clang-format | 0 .../lib}/TeensyTimerTool-master/.gitignore | 0 {lib => ASTRA/lib}/TeensyTimerTool-master/LICENSE | 0 {lib => ASTRA/lib}/TeensyTimerTool-master/README.md | 0 .../lib}/TeensyTimerTool-master/assets/FTM0_8CH.jpg | Bin .../lib}/TeensyTimerTool-master/examples/.gitignore | 0 .../01_Basic/ArrayOfTimers/ArrayOfTimers.ino | 0 .../examples/01_Basic/ArrayOfTimers/README.md | 0 .../examples/01_Basic/HelloOneShot/HelloOneShot.ino | 0 .../01_Basic/HelloPeriodic/HelloPeriodic.ino | 0 .../examples/01_Basic/MoreTimers/MoreTimers.ino | 0 .../examples/01_Basic/RTC_Timer/RTC_Timer.ino | 0 .../UsingChronoDurations1/UsingChronoDurations1.ino | 0 .../UsingChronoDurations2/UsingChronoDurations2.ino | 0 .../CallbackWithParams/CallbackWithParams.ino | 0 .../CapturingLambdas/CapturingLambdas.ino | 0 .../02_Advanced/UsingLambdas/UsingLambdas.ino | 0 .../DoubleExposure/DoubleExposure.ino | 0 .../DoubleExposure/LaserController.h | 0 .../03_Applications/DoubleExposure/PulseGenerator.h | 0 .../03_Applications/DoubleExposure/README.md | 0 .../DoubleExposure/SystemController.h | 0 .../examples/99_Misc/PinInformation/.clang-format | 0 .../examples/99_Misc/PinInformation/.gitignore | 0 .../examples/99_Misc/PinInformation/GPIO_Info.h | 0 .../examples/99_Misc/PinInformation/PWM_TimerInfo.c | 0 .../examples/99_Misc/PinInformation/PWM_TimerInfo.h | 0 .../examples/99_Misc/PinInformation/PinInfo.h | 0 .../99_Misc/PinInformation/PinInformation.ino | 0 .../examples/99_Misc/PinInformation/boards.txt | 0 .../lib}/TeensyTimerTool-master/library.json | 0 .../lib}/TeensyTimerTool-master/library.properties | 0 .../lib}/TeensyTimerTool-master/src/API/Timer.cpp | 0 .../TeensyTimerTool-master/src/API/baseTimer.cpp | 0 .../lib}/TeensyTimerTool-master/src/API/baseTimer.h | 0 .../TeensyTimerTool-master/src/API/oneShotTimer.h | 0 .../TeensyTimerTool-master/src/API/periodicTimer.h | 0 .../lib}/TeensyTimerTool-master/src/API/timer.h | 0 .../src/ErrorHandling/error_codes.h | 0 .../src/ErrorHandling/error_handler.cpp | 0 .../src/ErrorHandling/error_handler.h | 0 .../lib}/TeensyTimerTool-master/src/ITimerChannel.h | 0 .../TeensyTimerTool-master/src/TeensyTimerTool.h | 0 .../src/TimerModules/FTM/FTM.h | 0 .../src/TimerModules/FTM/FTM_Channel.h | 0 .../src/TimerModules/FTM/FTM_ChannelInfo.h | 0 .../src/TimerModules/FTM/FTM_Info.h | 0 .../src/TimerModules/GPT/GPT.h | 0 .../src/TimerModules/GPT/GPTChannel.cpp | 0 .../src/TimerModules/GPT/GPTChannel.h | 0 .../src/TimerModules/GPT/GPTmap.h | 0 .../src/TimerModules/PIT4/PIT.cpp | 0 .../src/TimerModules/PIT4/PIT.h | 0 .../src/TimerModules/PIT4/PITChannel.h | 0 .../src/TimerModules/TCK/TCK.cpp | 0 .../src/TimerModules/TCK/TCK.h | 0 .../src/TimerModules/TCK/TckChannel.h | 0 .../src/TimerModules/TCK/TckChannelBase.cpp | 0 .../src/TimerModules/TCK/TckChannelBase.h | 0 .../src/TimerModules/TCK/tickCounters.cpp | 0 .../src/TimerModules/TCK/tickCounters.h | 0 .../src/TimerModules/TMR/TMR.h | 0 .../src/TimerModules/TMR/TMRChannel.h | 0 .../lib}/TeensyTimerTool-master/src/boardDef.h | 0 .../lib}/TeensyTimerTool-master/src/config.cpp | 0 .../lib}/TeensyTimerTool-master/src/config.h | 0 .../lib}/TeensyTimerTool-master/src/defaultConfig.h | 0 .../src/frequency.h.deactivated | 0 .../lib}/TeensyTimerTool-master/src/helpers.h | 0 .../TeensyTimerTool-master/src/staticFunctional.h | 0 .../lib}/TeensyTimerTool-master/src/types.h | 0 .../lib}/TeensyTimerTool-master/test/main.cpp | 0 {lib => ASTRA/lib}/teensyshot-master/.gitignore | 0 .../lib}/teensyshot-master/Arda/dma_v1.ino | 0 .../Arda/dshot_simple_api/.gitignore | 0 .../Arda/dshot_simple_api/include/dshot_api.h | 0 .../Arda/dshot_simple_api/platformio.ini | 0 .../Arda/dshot_simple_api/src/dshot_api.cpp | 0 .../Arda/dshot_simple_api/src/main.cpp | 0 .../lib}/teensyshot-master/ESCPID/AWPID.cpp | 0 {lib => ASTRA/lib}/teensyshot-master/ESCPID/AWPID.h | 0 .../lib}/teensyshot-master/ESCPID/DSHOT.cpp | 0 {lib => ASTRA/lib}/teensyshot-master/ESCPID/DSHOT.h | 0 .../lib}/teensyshot-master/ESCPID/ESCCMD.cpp | 0 .../lib}/teensyshot-master/ESCPID/ESCCMD.h | 0 .../lib}/teensyshot-master/ESCPID/ESCPID.h | 0 .../lib}/teensyshot-master/ESCPID/ESCPID.ino | 0 {lib => ASTRA/lib}/teensyshot-master/LICENSE | 0 {lib => ASTRA/lib}/teensyshot-master/README.md | 0 {lib => ASTRA/lib}/teensyshot-master/_config.yml | 0 .../lib}/teensyshot-master/docs/BLHeli32 cmd.pdf | Bin .../teensyshot-master/docs/K64P144M120SF5RM.pdf | Bin .../lib}/teensyshot-master/docs/KISS_telemetry.pdf | Bin .../teensyshot-master/docs/PID AW explained.pdf | Bin {lib => ASTRA/lib}/teensyshot-master/docs/PID.pdf | Bin .../lib}/teensyshot-master/docs/RT1060.pdf | Bin .../lib}/teensyshot-master/docs/RT1060_eFlexPWM.pdf | Bin .../lib}/teensyshot-master/docs/RT1060_pin_mux.pdf | Bin {lib => ASTRA/lib}/teensyshot-master/host/host.c | 0 {lib => ASTRA/lib}/teensyshot-master/host/host.h | 0 {src => ASTRA/src}/testing/DiyShot/.gitignore | 0 .../src}/testing/DiyShot/.vscode/extensions.json | 0 {src => ASTRA/src}/testing/DiyShot/include/README | 0 {src => ASTRA/src}/testing/DiyShot/lib/README | 0 {src => ASTRA/src}/testing/DiyShot/platformio.ini | 0 {src => ASTRA/src}/testing/DiyShot/src/main.cpp | 0 {src => ASTRA/src}/testing/DiyShot/test/README | 0 .../src}/testing/ESC_emulation_test/.gitignore | 0 .../ESC_emulation_test/.vscode/extensions.json | 0 .../src}/testing/ESC_emulation_test/include/README | 0 .../src}/testing/ESC_emulation_test/lib/README | 0 .../src}/testing/ESC_emulation_test/platformio.ini | 0 .../src}/testing/ESC_emulation_test/src/main.cpp | 0 .../src}/testing/ESC_emulation_test/test/README | 0 .../src}/testing/servo_test_project/.gitignore | 0 .../servo_test_project/.vscode/extensions.json | 0 .../src}/testing/servo_test_project/include/README | 0 .../src}/testing/servo_test_project/lib/README | 0 .../src}/testing/servo_test_project/platformio.ini | 0 .../src}/testing/servo_test_project/src/main.cpp | 0 .../src}/testing/servo_test_project/test/README | 0 README.md | 12 +++++++++++- 195 files changed, 11 insertions(+), 1 deletion(-) rename {lib => ASTRA/lib}/HX711-master/.gitignore (100%) rename {lib => ASTRA/lib}/HX711-master/.travis.yml (100%) rename {lib => ASTRA/lib}/HX711-master/CMakeLists.txt (100%) rename {lib => ASTRA/lib}/HX711-master/CONTRIBUTORS.md (100%) rename {lib => ASTRA/lib}/HX711-master/LICENSE (100%) rename {lib => ASTRA/lib}/HX711-master/Makefile (100%) rename {lib => ASTRA/lib}/HX711-master/README.md (100%) rename {lib => ASTRA/lib}/HX711-master/doc/faq.md (100%) rename {lib => ASTRA/lib}/HX711-master/doc/notes.md (100%) rename {lib => ASTRA/lib}/HX711-master/doc/platformio-howto.md (100%) rename {lib => ASTRA/lib}/HX711-master/examples/HX711_basic_example/HX711_basic_example.ino (100%) rename {lib => ASTRA/lib}/HX711-master/examples/HX711_full_example/HX711_full_example.ino (100%) rename {lib => ASTRA/lib}/HX711-master/examples/HX711_retry_example/HX711_retry_example.ino (100%) rename {lib => ASTRA/lib}/HX711-master/examples/HX711_timeout_example/HX711_timeout_example.ino (100%) rename {lib => ASTRA/lib}/HX711-master/keywords.txt (100%) rename {lib => ASTRA/lib}/HX711-master/library.json (100%) rename {lib => ASTRA/lib}/HX711-master/library.properties (100%) rename {lib => ASTRA/lib}/HX711-master/platformio.ini (100%) rename {lib => ASTRA/lib}/HX711-master/src/HX711.cpp (100%) rename {lib => ASTRA/lib}/HX711-master/src/HX711.h (100%) rename {lib => ASTRA/lib}/Servo-master/.codespellrc (100%) rename {lib => ASTRA/lib}/Servo-master/.github/dependabot.yml (100%) rename {lib => ASTRA/lib}/Servo-master/.github/workflows/check-arduino.yml (100%) rename {lib => ASTRA/lib}/Servo-master/.github/workflows/compile-examples.yml (100%) rename {lib => ASTRA/lib}/Servo-master/.github/workflows/report-size-deltas.yml (100%) rename {lib => ASTRA/lib}/Servo-master/.github/workflows/spell-check.yml (100%) rename {lib => ASTRA/lib}/Servo-master/.github/workflows/sync-labels.yml (100%) rename {lib => ASTRA/lib}/Servo-master/LICENSE.txt (100%) rename {lib => ASTRA/lib}/Servo-master/README.adoc (100%) rename {lib => ASTRA/lib}/Servo-master/docs/api.md (100%) rename {lib => ASTRA/lib}/Servo-master/docs/readme.md (100%) rename {lib => ASTRA/lib}/Servo-master/examples/Knob/Knob.ino (100%) rename {lib => ASTRA/lib}/Servo-master/examples/Knob/images/knob_BB.png (100%) rename {lib => ASTRA/lib}/Servo-master/examples/Knob/images/knob_schem.png (100%) rename {lib => ASTRA/lib}/Servo-master/examples/Knob/readme.md (100%) rename {lib => ASTRA/lib}/Servo-master/examples/Sweep/Sweep.ino (100%) rename {lib => ASTRA/lib}/Servo-master/examples/Sweep/images/sweep_bb.png (100%) rename {lib => ASTRA/lib}/Servo-master/examples/Sweep/images/sweep_schem.png (100%) rename {lib => ASTRA/lib}/Servo-master/examples/Sweep/readme.md (100%) rename {lib => ASTRA/lib}/Servo-master/keywords.txt (100%) rename {lib => ASTRA/lib}/Servo-master/library.properties (100%) rename {lib => ASTRA/lib}/Servo-master/src/Servo.h (100%) rename {lib => ASTRA/lib}/Servo-master/src/avr/Servo.cpp (100%) rename {lib => ASTRA/lib}/Servo-master/src/avr/ServoTimers.h (100%) rename {lib => ASTRA/lib}/Servo-master/src/mbed/Servo.cpp (100%) rename {lib => ASTRA/lib}/Servo-master/src/mbed/ServoTimers.h (100%) rename {lib => ASTRA/lib}/Servo-master/src/megaavr/Servo.cpp (100%) rename {lib => ASTRA/lib}/Servo-master/src/megaavr/ServoTimers.h (100%) rename {lib => ASTRA/lib}/Servo-master/src/nrf52/Servo.cpp (100%) rename {lib => ASTRA/lib}/Servo-master/src/nrf52/ServoTimers.h (100%) rename {lib => ASTRA/lib}/Servo-master/src/sam/Servo.cpp (100%) rename {lib => ASTRA/lib}/Servo-master/src/sam/ServoTimers.h (100%) rename {lib => ASTRA/lib}/Servo-master/src/samd/Servo.cpp (100%) rename {lib => ASTRA/lib}/Servo-master/src/samd/ServoTimers.h (100%) rename {lib => ASTRA/lib}/Servo-master/src/stm32f4/Servo.cpp (100%) rename {lib => ASTRA/lib}/Servo-master/src/stm32f4/ServoTimers.h (100%) rename {lib => ASTRA/lib}/TeensyThreads-master/TeensyThreads-asm.S (100%) rename {lib => ASTRA/lib}/TeensyThreads-master/TeensyThreads.cpp (100%) rename {lib => ASTRA/lib}/TeensyThreads-master/TeensyThreads.h (100%) rename {lib => ASTRA/lib}/TeensyThreads-master/TeensyThreads.zip (100%) rename {lib => ASTRA/lib}/TeensyThreads-master/examples/Blink/Blink.ino (100%) rename {lib => ASTRA/lib}/TeensyThreads-master/examples/Deepsleep/Deepsleep.ino (100%) rename {lib => ASTRA/lib}/TeensyThreads-master/examples/Print/Print.ino (100%) rename {lib => ASTRA/lib}/TeensyThreads-master/examples/Runnable/LED.cpp (100%) rename {lib => ASTRA/lib}/TeensyThreads-master/examples/Runnable/LED.h (100%) rename {lib => ASTRA/lib}/TeensyThreads-master/examples/Runnable/README.txt (100%) rename {lib => ASTRA/lib}/TeensyThreads-master/examples/Runnable/Runnable.h (100%) rename {lib => ASTRA/lib}/TeensyThreads-master/examples/Runnable/main.ino (100%) rename {lib => ASTRA/lib}/TeensyThreads-master/examples/Tests/Tests.ino (100%) rename {lib => ASTRA/lib}/TeensyThreads-master/keywords.txt (100%) rename {lib => ASTRA/lib}/TeensyThreads-master/library.properties (100%) rename {lib => ASTRA/lib}/TeensyThreads-master/license.txt (100%) rename {lib => ASTRA/lib}/TeensyThreads-master/readme.md (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/.clang-format (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/.gitignore (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/LICENSE (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/README.md (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/assets/FTM0_8CH.jpg (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/.gitignore (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/01_Basic/ArrayOfTimers/ArrayOfTimers.ino (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/01_Basic/ArrayOfTimers/README.md (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/01_Basic/HelloOneShot/HelloOneShot.ino (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/01_Basic/HelloPeriodic/HelloPeriodic.ino (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/01_Basic/MoreTimers/MoreTimers.ino (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/01_Basic/RTC_Timer/RTC_Timer.ino (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/01_Basic/UsingChronoDurations1/UsingChronoDurations1.ino (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/01_Basic/UsingChronoDurations2/UsingChronoDurations2.ino (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/02_Advanced/CallbackWithParams/CallbackWithParams.ino (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/02_Advanced/CapturingLambdas/CapturingLambdas.ino (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/02_Advanced/UsingLambdas/UsingLambdas.ino (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/DoubleExposure.ino (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/LaserController.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/PulseGenerator.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/README.md (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/SystemController.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/99_Misc/PinInformation/.clang-format (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/99_Misc/PinInformation/.gitignore (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/99_Misc/PinInformation/GPIO_Info.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/99_Misc/PinInformation/PWM_TimerInfo.c (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/99_Misc/PinInformation/PWM_TimerInfo.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/99_Misc/PinInformation/PinInfo.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/99_Misc/PinInformation/PinInformation.ino (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/examples/99_Misc/PinInformation/boards.txt (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/library.json (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/library.properties (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/API/Timer.cpp (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/API/baseTimer.cpp (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/API/baseTimer.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/API/oneShotTimer.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/API/periodicTimer.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/API/timer.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/ErrorHandling/error_codes.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/ErrorHandling/error_handler.cpp (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/ErrorHandling/error_handler.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/ITimerChannel.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TeensyTimerTool.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/FTM/FTM.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/FTM/FTM_Channel.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/FTM/FTM_ChannelInfo.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/FTM/FTM_Info.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/GPT/GPT.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/GPT/GPTChannel.cpp (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/GPT/GPTChannel.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/GPT/GPTmap.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/PIT4/PIT.cpp (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/PIT4/PIT.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/PIT4/PITChannel.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/TCK/TCK.cpp (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/TCK/TCK.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/TCK/TckChannel.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/TCK/TckChannelBase.cpp (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/TCK/TckChannelBase.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/TCK/tickCounters.cpp (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/TCK/tickCounters.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/TMR/TMR.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/TimerModules/TMR/TMRChannel.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/boardDef.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/config.cpp (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/config.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/defaultConfig.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/frequency.h.deactivated (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/helpers.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/staticFunctional.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/src/types.h (100%) rename {lib => ASTRA/lib}/TeensyTimerTool-master/test/main.cpp (100%) rename {lib => ASTRA/lib}/teensyshot-master/.gitignore (100%) rename {lib => ASTRA/lib}/teensyshot-master/Arda/dma_v1.ino (100%) rename {lib => ASTRA/lib}/teensyshot-master/Arda/dshot_simple_api/.gitignore (100%) rename {lib => ASTRA/lib}/teensyshot-master/Arda/dshot_simple_api/include/dshot_api.h (100%) rename {lib => ASTRA/lib}/teensyshot-master/Arda/dshot_simple_api/platformio.ini (100%) rename {lib => ASTRA/lib}/teensyshot-master/Arda/dshot_simple_api/src/dshot_api.cpp (100%) rename {lib => ASTRA/lib}/teensyshot-master/Arda/dshot_simple_api/src/main.cpp (100%) rename {lib => ASTRA/lib}/teensyshot-master/ESCPID/AWPID.cpp (100%) rename {lib => ASTRA/lib}/teensyshot-master/ESCPID/AWPID.h (100%) rename {lib => ASTRA/lib}/teensyshot-master/ESCPID/DSHOT.cpp (100%) rename {lib => ASTRA/lib}/teensyshot-master/ESCPID/DSHOT.h (100%) rename {lib => ASTRA/lib}/teensyshot-master/ESCPID/ESCCMD.cpp (100%) rename {lib => ASTRA/lib}/teensyshot-master/ESCPID/ESCCMD.h (100%) rename {lib => ASTRA/lib}/teensyshot-master/ESCPID/ESCPID.h (100%) rename {lib => ASTRA/lib}/teensyshot-master/ESCPID/ESCPID.ino (100%) rename {lib => ASTRA/lib}/teensyshot-master/LICENSE (100%) rename {lib => ASTRA/lib}/teensyshot-master/README.md (100%) rename {lib => ASTRA/lib}/teensyshot-master/_config.yml (100%) rename {lib => ASTRA/lib}/teensyshot-master/docs/BLHeli32 cmd.pdf (100%) rename {lib => ASTRA/lib}/teensyshot-master/docs/K64P144M120SF5RM.pdf (100%) rename {lib => ASTRA/lib}/teensyshot-master/docs/KISS_telemetry.pdf (100%) rename {lib => ASTRA/lib}/teensyshot-master/docs/PID AW explained.pdf (100%) rename {lib => ASTRA/lib}/teensyshot-master/docs/PID.pdf (100%) rename {lib => ASTRA/lib}/teensyshot-master/docs/RT1060.pdf (100%) rename {lib => ASTRA/lib}/teensyshot-master/docs/RT1060_eFlexPWM.pdf (100%) rename {lib => ASTRA/lib}/teensyshot-master/docs/RT1060_pin_mux.pdf (100%) rename {lib => ASTRA/lib}/teensyshot-master/host/host.c (100%) rename {lib => ASTRA/lib}/teensyshot-master/host/host.h (100%) rename {src => ASTRA/src}/testing/DiyShot/.gitignore (100%) rename {src => ASTRA/src}/testing/DiyShot/.vscode/extensions.json (100%) rename {src => ASTRA/src}/testing/DiyShot/include/README (100%) rename {src => ASTRA/src}/testing/DiyShot/lib/README (100%) rename {src => ASTRA/src}/testing/DiyShot/platformio.ini (100%) rename {src => ASTRA/src}/testing/DiyShot/src/main.cpp (100%) rename {src => ASTRA/src}/testing/DiyShot/test/README (100%) rename {src => ASTRA/src}/testing/ESC_emulation_test/.gitignore (100%) rename {src => ASTRA/src}/testing/ESC_emulation_test/.vscode/extensions.json (100%) rename {src => ASTRA/src}/testing/ESC_emulation_test/include/README (100%) rename {src => ASTRA/src}/testing/ESC_emulation_test/lib/README (100%) rename {src => ASTRA/src}/testing/ESC_emulation_test/platformio.ini (100%) rename {src => ASTRA/src}/testing/ESC_emulation_test/src/main.cpp (100%) rename {src => ASTRA/src}/testing/ESC_emulation_test/test/README (100%) rename {src => ASTRA/src}/testing/servo_test_project/.gitignore (100%) rename {src => ASTRA/src}/testing/servo_test_project/.vscode/extensions.json (100%) rename {src => ASTRA/src}/testing/servo_test_project/include/README (100%) rename {src => ASTRA/src}/testing/servo_test_project/lib/README (100%) rename {src => ASTRA/src}/testing/servo_test_project/platformio.ini (100%) rename {src => ASTRA/src}/testing/servo_test_project/src/main.cpp (100%) rename {src => ASTRA/src}/testing/servo_test_project/test/README (100%) diff --git a/lib/HX711-master/.gitignore b/ASTRA/lib/HX711-master/.gitignore similarity index 100% rename from lib/HX711-master/.gitignore rename to ASTRA/lib/HX711-master/.gitignore diff --git a/lib/HX711-master/.travis.yml b/ASTRA/lib/HX711-master/.travis.yml similarity index 100% rename from lib/HX711-master/.travis.yml rename to ASTRA/lib/HX711-master/.travis.yml diff --git a/lib/HX711-master/CMakeLists.txt b/ASTRA/lib/HX711-master/CMakeLists.txt similarity index 100% rename from lib/HX711-master/CMakeLists.txt rename to ASTRA/lib/HX711-master/CMakeLists.txt diff --git a/lib/HX711-master/CONTRIBUTORS.md b/ASTRA/lib/HX711-master/CONTRIBUTORS.md similarity index 100% rename from lib/HX711-master/CONTRIBUTORS.md rename to ASTRA/lib/HX711-master/CONTRIBUTORS.md diff --git a/lib/HX711-master/LICENSE b/ASTRA/lib/HX711-master/LICENSE similarity index 100% rename from lib/HX711-master/LICENSE rename to ASTRA/lib/HX711-master/LICENSE diff --git a/lib/HX711-master/Makefile b/ASTRA/lib/HX711-master/Makefile similarity index 100% rename from lib/HX711-master/Makefile rename to ASTRA/lib/HX711-master/Makefile diff --git a/lib/HX711-master/README.md b/ASTRA/lib/HX711-master/README.md similarity index 100% rename from lib/HX711-master/README.md rename to ASTRA/lib/HX711-master/README.md diff --git a/lib/HX711-master/doc/faq.md b/ASTRA/lib/HX711-master/doc/faq.md similarity index 100% rename from lib/HX711-master/doc/faq.md rename to ASTRA/lib/HX711-master/doc/faq.md diff --git a/lib/HX711-master/doc/notes.md b/ASTRA/lib/HX711-master/doc/notes.md similarity index 100% rename from lib/HX711-master/doc/notes.md rename to ASTRA/lib/HX711-master/doc/notes.md diff --git a/lib/HX711-master/doc/platformio-howto.md b/ASTRA/lib/HX711-master/doc/platformio-howto.md similarity index 100% rename from lib/HX711-master/doc/platformio-howto.md rename to ASTRA/lib/HX711-master/doc/platformio-howto.md diff --git a/lib/HX711-master/examples/HX711_basic_example/HX711_basic_example.ino b/ASTRA/lib/HX711-master/examples/HX711_basic_example/HX711_basic_example.ino similarity index 100% rename from lib/HX711-master/examples/HX711_basic_example/HX711_basic_example.ino rename to ASTRA/lib/HX711-master/examples/HX711_basic_example/HX711_basic_example.ino diff --git a/lib/HX711-master/examples/HX711_full_example/HX711_full_example.ino b/ASTRA/lib/HX711-master/examples/HX711_full_example/HX711_full_example.ino similarity index 100% rename from lib/HX711-master/examples/HX711_full_example/HX711_full_example.ino rename to ASTRA/lib/HX711-master/examples/HX711_full_example/HX711_full_example.ino diff --git a/lib/HX711-master/examples/HX711_retry_example/HX711_retry_example.ino b/ASTRA/lib/HX711-master/examples/HX711_retry_example/HX711_retry_example.ino similarity index 100% rename from lib/HX711-master/examples/HX711_retry_example/HX711_retry_example.ino rename to ASTRA/lib/HX711-master/examples/HX711_retry_example/HX711_retry_example.ino diff --git a/lib/HX711-master/examples/HX711_timeout_example/HX711_timeout_example.ino b/ASTRA/lib/HX711-master/examples/HX711_timeout_example/HX711_timeout_example.ino similarity index 100% rename from lib/HX711-master/examples/HX711_timeout_example/HX711_timeout_example.ino rename to ASTRA/lib/HX711-master/examples/HX711_timeout_example/HX711_timeout_example.ino diff --git a/lib/HX711-master/keywords.txt b/ASTRA/lib/HX711-master/keywords.txt similarity index 100% rename from lib/HX711-master/keywords.txt rename to ASTRA/lib/HX711-master/keywords.txt diff --git a/lib/HX711-master/library.json b/ASTRA/lib/HX711-master/library.json similarity index 100% rename from lib/HX711-master/library.json rename to ASTRA/lib/HX711-master/library.json diff --git a/lib/HX711-master/library.properties b/ASTRA/lib/HX711-master/library.properties similarity index 100% rename from lib/HX711-master/library.properties rename to ASTRA/lib/HX711-master/library.properties diff --git a/lib/HX711-master/platformio.ini b/ASTRA/lib/HX711-master/platformio.ini similarity index 100% rename from lib/HX711-master/platformio.ini rename to ASTRA/lib/HX711-master/platformio.ini diff --git a/lib/HX711-master/src/HX711.cpp b/ASTRA/lib/HX711-master/src/HX711.cpp similarity index 100% rename from lib/HX711-master/src/HX711.cpp rename to ASTRA/lib/HX711-master/src/HX711.cpp diff --git a/lib/HX711-master/src/HX711.h b/ASTRA/lib/HX711-master/src/HX711.h similarity index 100% rename from lib/HX711-master/src/HX711.h rename to ASTRA/lib/HX711-master/src/HX711.h diff --git a/lib/Servo-master/.codespellrc b/ASTRA/lib/Servo-master/.codespellrc similarity index 100% rename from lib/Servo-master/.codespellrc rename to ASTRA/lib/Servo-master/.codespellrc diff --git a/lib/Servo-master/.github/dependabot.yml b/ASTRA/lib/Servo-master/.github/dependabot.yml similarity index 100% rename from lib/Servo-master/.github/dependabot.yml rename to ASTRA/lib/Servo-master/.github/dependabot.yml diff --git a/lib/Servo-master/.github/workflows/check-arduino.yml b/ASTRA/lib/Servo-master/.github/workflows/check-arduino.yml similarity index 100% rename from lib/Servo-master/.github/workflows/check-arduino.yml rename to ASTRA/lib/Servo-master/.github/workflows/check-arduino.yml diff --git a/lib/Servo-master/.github/workflows/compile-examples.yml b/ASTRA/lib/Servo-master/.github/workflows/compile-examples.yml similarity index 100% rename from lib/Servo-master/.github/workflows/compile-examples.yml rename to ASTRA/lib/Servo-master/.github/workflows/compile-examples.yml diff --git a/lib/Servo-master/.github/workflows/report-size-deltas.yml b/ASTRA/lib/Servo-master/.github/workflows/report-size-deltas.yml similarity index 100% rename from lib/Servo-master/.github/workflows/report-size-deltas.yml rename to ASTRA/lib/Servo-master/.github/workflows/report-size-deltas.yml diff --git a/lib/Servo-master/.github/workflows/spell-check.yml b/ASTRA/lib/Servo-master/.github/workflows/spell-check.yml similarity index 100% rename from lib/Servo-master/.github/workflows/spell-check.yml rename to ASTRA/lib/Servo-master/.github/workflows/spell-check.yml diff --git a/lib/Servo-master/.github/workflows/sync-labels.yml b/ASTRA/lib/Servo-master/.github/workflows/sync-labels.yml similarity index 100% rename from lib/Servo-master/.github/workflows/sync-labels.yml rename to ASTRA/lib/Servo-master/.github/workflows/sync-labels.yml diff --git a/lib/Servo-master/LICENSE.txt b/ASTRA/lib/Servo-master/LICENSE.txt similarity index 100% rename from lib/Servo-master/LICENSE.txt rename to ASTRA/lib/Servo-master/LICENSE.txt diff --git a/lib/Servo-master/README.adoc b/ASTRA/lib/Servo-master/README.adoc similarity index 100% rename from lib/Servo-master/README.adoc rename to ASTRA/lib/Servo-master/README.adoc diff --git a/lib/Servo-master/docs/api.md b/ASTRA/lib/Servo-master/docs/api.md similarity index 100% rename from lib/Servo-master/docs/api.md rename to ASTRA/lib/Servo-master/docs/api.md diff --git a/lib/Servo-master/docs/readme.md b/ASTRA/lib/Servo-master/docs/readme.md similarity index 100% rename from lib/Servo-master/docs/readme.md rename to ASTRA/lib/Servo-master/docs/readme.md diff --git a/lib/Servo-master/examples/Knob/Knob.ino b/ASTRA/lib/Servo-master/examples/Knob/Knob.ino similarity index 100% rename from lib/Servo-master/examples/Knob/Knob.ino rename to ASTRA/lib/Servo-master/examples/Knob/Knob.ino diff --git a/lib/Servo-master/examples/Knob/images/knob_BB.png b/ASTRA/lib/Servo-master/examples/Knob/images/knob_BB.png similarity index 100% rename from lib/Servo-master/examples/Knob/images/knob_BB.png rename to ASTRA/lib/Servo-master/examples/Knob/images/knob_BB.png diff --git a/lib/Servo-master/examples/Knob/images/knob_schem.png b/ASTRA/lib/Servo-master/examples/Knob/images/knob_schem.png similarity index 100% rename from lib/Servo-master/examples/Knob/images/knob_schem.png rename to ASTRA/lib/Servo-master/examples/Knob/images/knob_schem.png diff --git a/lib/Servo-master/examples/Knob/readme.md b/ASTRA/lib/Servo-master/examples/Knob/readme.md similarity index 100% rename from lib/Servo-master/examples/Knob/readme.md rename to ASTRA/lib/Servo-master/examples/Knob/readme.md diff --git a/lib/Servo-master/examples/Sweep/Sweep.ino b/ASTRA/lib/Servo-master/examples/Sweep/Sweep.ino similarity index 100% rename from lib/Servo-master/examples/Sweep/Sweep.ino rename to ASTRA/lib/Servo-master/examples/Sweep/Sweep.ino diff --git a/lib/Servo-master/examples/Sweep/images/sweep_bb.png b/ASTRA/lib/Servo-master/examples/Sweep/images/sweep_bb.png similarity index 100% rename from lib/Servo-master/examples/Sweep/images/sweep_bb.png rename to ASTRA/lib/Servo-master/examples/Sweep/images/sweep_bb.png diff --git a/lib/Servo-master/examples/Sweep/images/sweep_schem.png b/ASTRA/lib/Servo-master/examples/Sweep/images/sweep_schem.png similarity index 100% rename from lib/Servo-master/examples/Sweep/images/sweep_schem.png rename to ASTRA/lib/Servo-master/examples/Sweep/images/sweep_schem.png diff --git a/lib/Servo-master/examples/Sweep/readme.md b/ASTRA/lib/Servo-master/examples/Sweep/readme.md similarity index 100% rename from lib/Servo-master/examples/Sweep/readme.md rename to ASTRA/lib/Servo-master/examples/Sweep/readme.md diff --git a/lib/Servo-master/keywords.txt b/ASTRA/lib/Servo-master/keywords.txt similarity index 100% rename from lib/Servo-master/keywords.txt rename to ASTRA/lib/Servo-master/keywords.txt diff --git a/lib/Servo-master/library.properties b/ASTRA/lib/Servo-master/library.properties similarity index 100% rename from lib/Servo-master/library.properties rename to ASTRA/lib/Servo-master/library.properties diff --git a/lib/Servo-master/src/Servo.h b/ASTRA/lib/Servo-master/src/Servo.h similarity index 100% rename from lib/Servo-master/src/Servo.h rename to ASTRA/lib/Servo-master/src/Servo.h diff --git a/lib/Servo-master/src/avr/Servo.cpp b/ASTRA/lib/Servo-master/src/avr/Servo.cpp similarity index 100% rename from lib/Servo-master/src/avr/Servo.cpp rename to ASTRA/lib/Servo-master/src/avr/Servo.cpp diff --git a/lib/Servo-master/src/avr/ServoTimers.h b/ASTRA/lib/Servo-master/src/avr/ServoTimers.h similarity index 100% rename from lib/Servo-master/src/avr/ServoTimers.h rename to ASTRA/lib/Servo-master/src/avr/ServoTimers.h diff --git a/lib/Servo-master/src/mbed/Servo.cpp b/ASTRA/lib/Servo-master/src/mbed/Servo.cpp similarity index 100% rename from lib/Servo-master/src/mbed/Servo.cpp rename to ASTRA/lib/Servo-master/src/mbed/Servo.cpp diff --git a/lib/Servo-master/src/mbed/ServoTimers.h b/ASTRA/lib/Servo-master/src/mbed/ServoTimers.h similarity index 100% rename from lib/Servo-master/src/mbed/ServoTimers.h rename to ASTRA/lib/Servo-master/src/mbed/ServoTimers.h diff --git a/lib/Servo-master/src/megaavr/Servo.cpp b/ASTRA/lib/Servo-master/src/megaavr/Servo.cpp similarity index 100% rename from lib/Servo-master/src/megaavr/Servo.cpp rename to ASTRA/lib/Servo-master/src/megaavr/Servo.cpp diff --git a/lib/Servo-master/src/megaavr/ServoTimers.h b/ASTRA/lib/Servo-master/src/megaavr/ServoTimers.h similarity index 100% rename from lib/Servo-master/src/megaavr/ServoTimers.h rename to ASTRA/lib/Servo-master/src/megaavr/ServoTimers.h diff --git a/lib/Servo-master/src/nrf52/Servo.cpp b/ASTRA/lib/Servo-master/src/nrf52/Servo.cpp similarity index 100% rename from lib/Servo-master/src/nrf52/Servo.cpp rename to ASTRA/lib/Servo-master/src/nrf52/Servo.cpp diff --git a/lib/Servo-master/src/nrf52/ServoTimers.h b/ASTRA/lib/Servo-master/src/nrf52/ServoTimers.h similarity index 100% rename from lib/Servo-master/src/nrf52/ServoTimers.h rename to ASTRA/lib/Servo-master/src/nrf52/ServoTimers.h diff --git a/lib/Servo-master/src/sam/Servo.cpp b/ASTRA/lib/Servo-master/src/sam/Servo.cpp similarity index 100% rename from lib/Servo-master/src/sam/Servo.cpp rename to ASTRA/lib/Servo-master/src/sam/Servo.cpp diff --git a/lib/Servo-master/src/sam/ServoTimers.h b/ASTRA/lib/Servo-master/src/sam/ServoTimers.h similarity index 100% rename from lib/Servo-master/src/sam/ServoTimers.h rename to ASTRA/lib/Servo-master/src/sam/ServoTimers.h diff --git a/lib/Servo-master/src/samd/Servo.cpp b/ASTRA/lib/Servo-master/src/samd/Servo.cpp similarity index 100% rename from lib/Servo-master/src/samd/Servo.cpp rename to ASTRA/lib/Servo-master/src/samd/Servo.cpp diff --git a/lib/Servo-master/src/samd/ServoTimers.h b/ASTRA/lib/Servo-master/src/samd/ServoTimers.h similarity index 100% rename from lib/Servo-master/src/samd/ServoTimers.h rename to ASTRA/lib/Servo-master/src/samd/ServoTimers.h diff --git a/lib/Servo-master/src/stm32f4/Servo.cpp b/ASTRA/lib/Servo-master/src/stm32f4/Servo.cpp similarity index 100% rename from lib/Servo-master/src/stm32f4/Servo.cpp rename to ASTRA/lib/Servo-master/src/stm32f4/Servo.cpp diff --git a/lib/Servo-master/src/stm32f4/ServoTimers.h b/ASTRA/lib/Servo-master/src/stm32f4/ServoTimers.h similarity index 100% rename from lib/Servo-master/src/stm32f4/ServoTimers.h rename to ASTRA/lib/Servo-master/src/stm32f4/ServoTimers.h diff --git a/lib/TeensyThreads-master/TeensyThreads-asm.S b/ASTRA/lib/TeensyThreads-master/TeensyThreads-asm.S similarity index 100% rename from lib/TeensyThreads-master/TeensyThreads-asm.S rename to ASTRA/lib/TeensyThreads-master/TeensyThreads-asm.S diff --git a/lib/TeensyThreads-master/TeensyThreads.cpp b/ASTRA/lib/TeensyThreads-master/TeensyThreads.cpp similarity index 100% rename from lib/TeensyThreads-master/TeensyThreads.cpp rename to ASTRA/lib/TeensyThreads-master/TeensyThreads.cpp diff --git a/lib/TeensyThreads-master/TeensyThreads.h b/ASTRA/lib/TeensyThreads-master/TeensyThreads.h similarity index 100% rename from lib/TeensyThreads-master/TeensyThreads.h rename to ASTRA/lib/TeensyThreads-master/TeensyThreads.h diff --git a/lib/TeensyThreads-master/TeensyThreads.zip b/ASTRA/lib/TeensyThreads-master/TeensyThreads.zip similarity index 100% rename from lib/TeensyThreads-master/TeensyThreads.zip rename to ASTRA/lib/TeensyThreads-master/TeensyThreads.zip diff --git a/lib/TeensyThreads-master/examples/Blink/Blink.ino b/ASTRA/lib/TeensyThreads-master/examples/Blink/Blink.ino similarity index 100% rename from lib/TeensyThreads-master/examples/Blink/Blink.ino rename to ASTRA/lib/TeensyThreads-master/examples/Blink/Blink.ino diff --git a/lib/TeensyThreads-master/examples/Deepsleep/Deepsleep.ino b/ASTRA/lib/TeensyThreads-master/examples/Deepsleep/Deepsleep.ino similarity index 100% rename from lib/TeensyThreads-master/examples/Deepsleep/Deepsleep.ino rename to ASTRA/lib/TeensyThreads-master/examples/Deepsleep/Deepsleep.ino diff --git a/lib/TeensyThreads-master/examples/Print/Print.ino b/ASTRA/lib/TeensyThreads-master/examples/Print/Print.ino similarity index 100% rename from lib/TeensyThreads-master/examples/Print/Print.ino rename to ASTRA/lib/TeensyThreads-master/examples/Print/Print.ino diff --git a/lib/TeensyThreads-master/examples/Runnable/LED.cpp b/ASTRA/lib/TeensyThreads-master/examples/Runnable/LED.cpp similarity index 100% rename from lib/TeensyThreads-master/examples/Runnable/LED.cpp rename to ASTRA/lib/TeensyThreads-master/examples/Runnable/LED.cpp diff --git a/lib/TeensyThreads-master/examples/Runnable/LED.h b/ASTRA/lib/TeensyThreads-master/examples/Runnable/LED.h similarity index 100% rename from lib/TeensyThreads-master/examples/Runnable/LED.h rename to ASTRA/lib/TeensyThreads-master/examples/Runnable/LED.h diff --git a/lib/TeensyThreads-master/examples/Runnable/README.txt b/ASTRA/lib/TeensyThreads-master/examples/Runnable/README.txt similarity index 100% rename from lib/TeensyThreads-master/examples/Runnable/README.txt rename to ASTRA/lib/TeensyThreads-master/examples/Runnable/README.txt diff --git a/lib/TeensyThreads-master/examples/Runnable/Runnable.h b/ASTRA/lib/TeensyThreads-master/examples/Runnable/Runnable.h similarity index 100% rename from lib/TeensyThreads-master/examples/Runnable/Runnable.h rename to ASTRA/lib/TeensyThreads-master/examples/Runnable/Runnable.h diff --git a/lib/TeensyThreads-master/examples/Runnable/main.ino b/ASTRA/lib/TeensyThreads-master/examples/Runnable/main.ino similarity index 100% rename from lib/TeensyThreads-master/examples/Runnable/main.ino rename to ASTRA/lib/TeensyThreads-master/examples/Runnable/main.ino diff --git a/lib/TeensyThreads-master/examples/Tests/Tests.ino b/ASTRA/lib/TeensyThreads-master/examples/Tests/Tests.ino similarity index 100% rename from lib/TeensyThreads-master/examples/Tests/Tests.ino rename to ASTRA/lib/TeensyThreads-master/examples/Tests/Tests.ino diff --git a/lib/TeensyThreads-master/keywords.txt b/ASTRA/lib/TeensyThreads-master/keywords.txt similarity index 100% rename from lib/TeensyThreads-master/keywords.txt rename to ASTRA/lib/TeensyThreads-master/keywords.txt diff --git a/lib/TeensyThreads-master/library.properties b/ASTRA/lib/TeensyThreads-master/library.properties similarity index 100% rename from lib/TeensyThreads-master/library.properties rename to ASTRA/lib/TeensyThreads-master/library.properties diff --git a/lib/TeensyThreads-master/license.txt b/ASTRA/lib/TeensyThreads-master/license.txt similarity index 100% rename from lib/TeensyThreads-master/license.txt rename to ASTRA/lib/TeensyThreads-master/license.txt diff --git a/lib/TeensyThreads-master/readme.md b/ASTRA/lib/TeensyThreads-master/readme.md similarity index 100% rename from lib/TeensyThreads-master/readme.md rename to ASTRA/lib/TeensyThreads-master/readme.md diff --git a/lib/TeensyTimerTool-master/.clang-format b/ASTRA/lib/TeensyTimerTool-master/.clang-format similarity index 100% rename from lib/TeensyTimerTool-master/.clang-format rename to ASTRA/lib/TeensyTimerTool-master/.clang-format diff --git a/lib/TeensyTimerTool-master/.gitignore b/ASTRA/lib/TeensyTimerTool-master/.gitignore similarity index 100% rename from lib/TeensyTimerTool-master/.gitignore rename to ASTRA/lib/TeensyTimerTool-master/.gitignore diff --git a/lib/TeensyTimerTool-master/LICENSE b/ASTRA/lib/TeensyTimerTool-master/LICENSE similarity index 100% rename from lib/TeensyTimerTool-master/LICENSE rename to ASTRA/lib/TeensyTimerTool-master/LICENSE diff --git a/lib/TeensyTimerTool-master/README.md b/ASTRA/lib/TeensyTimerTool-master/README.md similarity index 100% rename from lib/TeensyTimerTool-master/README.md rename to ASTRA/lib/TeensyTimerTool-master/README.md diff --git a/lib/TeensyTimerTool-master/assets/FTM0_8CH.jpg b/ASTRA/lib/TeensyTimerTool-master/assets/FTM0_8CH.jpg similarity index 100% rename from lib/TeensyTimerTool-master/assets/FTM0_8CH.jpg rename to ASTRA/lib/TeensyTimerTool-master/assets/FTM0_8CH.jpg diff --git a/lib/TeensyTimerTool-master/examples/.gitignore b/ASTRA/lib/TeensyTimerTool-master/examples/.gitignore similarity index 100% rename from lib/TeensyTimerTool-master/examples/.gitignore rename to ASTRA/lib/TeensyTimerTool-master/examples/.gitignore diff --git a/lib/TeensyTimerTool-master/examples/01_Basic/ArrayOfTimers/ArrayOfTimers.ino b/ASTRA/lib/TeensyTimerTool-master/examples/01_Basic/ArrayOfTimers/ArrayOfTimers.ino similarity index 100% rename from lib/TeensyTimerTool-master/examples/01_Basic/ArrayOfTimers/ArrayOfTimers.ino rename to ASTRA/lib/TeensyTimerTool-master/examples/01_Basic/ArrayOfTimers/ArrayOfTimers.ino diff --git a/lib/TeensyTimerTool-master/examples/01_Basic/ArrayOfTimers/README.md b/ASTRA/lib/TeensyTimerTool-master/examples/01_Basic/ArrayOfTimers/README.md similarity index 100% rename from lib/TeensyTimerTool-master/examples/01_Basic/ArrayOfTimers/README.md rename to ASTRA/lib/TeensyTimerTool-master/examples/01_Basic/ArrayOfTimers/README.md diff --git a/lib/TeensyTimerTool-master/examples/01_Basic/HelloOneShot/HelloOneShot.ino b/ASTRA/lib/TeensyTimerTool-master/examples/01_Basic/HelloOneShot/HelloOneShot.ino similarity index 100% rename from lib/TeensyTimerTool-master/examples/01_Basic/HelloOneShot/HelloOneShot.ino rename to ASTRA/lib/TeensyTimerTool-master/examples/01_Basic/HelloOneShot/HelloOneShot.ino diff --git a/lib/TeensyTimerTool-master/examples/01_Basic/HelloPeriodic/HelloPeriodic.ino b/ASTRA/lib/TeensyTimerTool-master/examples/01_Basic/HelloPeriodic/HelloPeriodic.ino similarity index 100% rename from lib/TeensyTimerTool-master/examples/01_Basic/HelloPeriodic/HelloPeriodic.ino rename to ASTRA/lib/TeensyTimerTool-master/examples/01_Basic/HelloPeriodic/HelloPeriodic.ino diff --git a/lib/TeensyTimerTool-master/examples/01_Basic/MoreTimers/MoreTimers.ino b/ASTRA/lib/TeensyTimerTool-master/examples/01_Basic/MoreTimers/MoreTimers.ino similarity index 100% rename from lib/TeensyTimerTool-master/examples/01_Basic/MoreTimers/MoreTimers.ino rename to ASTRA/lib/TeensyTimerTool-master/examples/01_Basic/MoreTimers/MoreTimers.ino diff --git a/lib/TeensyTimerTool-master/examples/01_Basic/RTC_Timer/RTC_Timer.ino b/ASTRA/lib/TeensyTimerTool-master/examples/01_Basic/RTC_Timer/RTC_Timer.ino similarity index 100% rename from lib/TeensyTimerTool-master/examples/01_Basic/RTC_Timer/RTC_Timer.ino rename to ASTRA/lib/TeensyTimerTool-master/examples/01_Basic/RTC_Timer/RTC_Timer.ino diff --git a/lib/TeensyTimerTool-master/examples/01_Basic/UsingChronoDurations1/UsingChronoDurations1.ino b/ASTRA/lib/TeensyTimerTool-master/examples/01_Basic/UsingChronoDurations1/UsingChronoDurations1.ino similarity index 100% rename from lib/TeensyTimerTool-master/examples/01_Basic/UsingChronoDurations1/UsingChronoDurations1.ino rename to ASTRA/lib/TeensyTimerTool-master/examples/01_Basic/UsingChronoDurations1/UsingChronoDurations1.ino diff --git a/lib/TeensyTimerTool-master/examples/01_Basic/UsingChronoDurations2/UsingChronoDurations2.ino b/ASTRA/lib/TeensyTimerTool-master/examples/01_Basic/UsingChronoDurations2/UsingChronoDurations2.ino similarity index 100% rename from lib/TeensyTimerTool-master/examples/01_Basic/UsingChronoDurations2/UsingChronoDurations2.ino rename to ASTRA/lib/TeensyTimerTool-master/examples/01_Basic/UsingChronoDurations2/UsingChronoDurations2.ino diff --git a/lib/TeensyTimerTool-master/examples/02_Advanced/CallbackWithParams/CallbackWithParams.ino b/ASTRA/lib/TeensyTimerTool-master/examples/02_Advanced/CallbackWithParams/CallbackWithParams.ino similarity index 100% rename from lib/TeensyTimerTool-master/examples/02_Advanced/CallbackWithParams/CallbackWithParams.ino rename to ASTRA/lib/TeensyTimerTool-master/examples/02_Advanced/CallbackWithParams/CallbackWithParams.ino diff --git a/lib/TeensyTimerTool-master/examples/02_Advanced/CapturingLambdas/CapturingLambdas.ino b/ASTRA/lib/TeensyTimerTool-master/examples/02_Advanced/CapturingLambdas/CapturingLambdas.ino similarity index 100% rename from lib/TeensyTimerTool-master/examples/02_Advanced/CapturingLambdas/CapturingLambdas.ino rename to ASTRA/lib/TeensyTimerTool-master/examples/02_Advanced/CapturingLambdas/CapturingLambdas.ino diff --git a/lib/TeensyTimerTool-master/examples/02_Advanced/UsingLambdas/UsingLambdas.ino b/ASTRA/lib/TeensyTimerTool-master/examples/02_Advanced/UsingLambdas/UsingLambdas.ino similarity index 100% rename from lib/TeensyTimerTool-master/examples/02_Advanced/UsingLambdas/UsingLambdas.ino rename to ASTRA/lib/TeensyTimerTool-master/examples/02_Advanced/UsingLambdas/UsingLambdas.ino diff --git a/lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/DoubleExposure.ino b/ASTRA/lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/DoubleExposure.ino similarity index 100% rename from lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/DoubleExposure.ino rename to ASTRA/lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/DoubleExposure.ino diff --git a/lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/LaserController.h b/ASTRA/lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/LaserController.h similarity index 100% rename from lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/LaserController.h rename to ASTRA/lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/LaserController.h diff --git a/lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/PulseGenerator.h b/ASTRA/lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/PulseGenerator.h similarity index 100% rename from lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/PulseGenerator.h rename to ASTRA/lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/PulseGenerator.h diff --git a/lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/README.md b/ASTRA/lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/README.md similarity index 100% rename from lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/README.md rename to ASTRA/lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/README.md diff --git a/lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/SystemController.h b/ASTRA/lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/SystemController.h similarity index 100% rename from lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/SystemController.h rename to ASTRA/lib/TeensyTimerTool-master/examples/03_Applications/DoubleExposure/SystemController.h diff --git a/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/.clang-format b/ASTRA/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/.clang-format similarity index 100% rename from lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/.clang-format rename to ASTRA/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/.clang-format diff --git a/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/.gitignore b/ASTRA/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/.gitignore similarity index 100% rename from lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/.gitignore rename to ASTRA/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/.gitignore diff --git a/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/GPIO_Info.h b/ASTRA/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/GPIO_Info.h similarity index 100% rename from lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/GPIO_Info.h rename to ASTRA/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/GPIO_Info.h diff --git a/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/PWM_TimerInfo.c b/ASTRA/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/PWM_TimerInfo.c similarity index 100% rename from lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/PWM_TimerInfo.c rename to ASTRA/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/PWM_TimerInfo.c diff --git a/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/PWM_TimerInfo.h b/ASTRA/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/PWM_TimerInfo.h similarity index 100% rename from lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/PWM_TimerInfo.h rename to ASTRA/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/PWM_TimerInfo.h diff --git a/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/PinInfo.h b/ASTRA/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/PinInfo.h similarity index 100% rename from lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/PinInfo.h rename to ASTRA/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/PinInfo.h diff --git a/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/PinInformation.ino b/ASTRA/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/PinInformation.ino similarity index 100% rename from lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/PinInformation.ino rename to ASTRA/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/PinInformation.ino diff --git a/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/boards.txt b/ASTRA/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/boards.txt similarity index 100% rename from lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/boards.txt rename to ASTRA/lib/TeensyTimerTool-master/examples/99_Misc/PinInformation/boards.txt diff --git a/lib/TeensyTimerTool-master/library.json b/ASTRA/lib/TeensyTimerTool-master/library.json similarity index 100% rename from lib/TeensyTimerTool-master/library.json rename to ASTRA/lib/TeensyTimerTool-master/library.json diff --git a/lib/TeensyTimerTool-master/library.properties b/ASTRA/lib/TeensyTimerTool-master/library.properties similarity index 100% rename from lib/TeensyTimerTool-master/library.properties rename to ASTRA/lib/TeensyTimerTool-master/library.properties diff --git a/lib/TeensyTimerTool-master/src/API/Timer.cpp b/ASTRA/lib/TeensyTimerTool-master/src/API/Timer.cpp similarity index 100% rename from lib/TeensyTimerTool-master/src/API/Timer.cpp rename to ASTRA/lib/TeensyTimerTool-master/src/API/Timer.cpp diff --git a/lib/TeensyTimerTool-master/src/API/baseTimer.cpp b/ASTRA/lib/TeensyTimerTool-master/src/API/baseTimer.cpp similarity index 100% rename from lib/TeensyTimerTool-master/src/API/baseTimer.cpp rename to ASTRA/lib/TeensyTimerTool-master/src/API/baseTimer.cpp diff --git a/lib/TeensyTimerTool-master/src/API/baseTimer.h b/ASTRA/lib/TeensyTimerTool-master/src/API/baseTimer.h similarity index 100% rename from lib/TeensyTimerTool-master/src/API/baseTimer.h rename to ASTRA/lib/TeensyTimerTool-master/src/API/baseTimer.h diff --git a/lib/TeensyTimerTool-master/src/API/oneShotTimer.h b/ASTRA/lib/TeensyTimerTool-master/src/API/oneShotTimer.h similarity index 100% rename from lib/TeensyTimerTool-master/src/API/oneShotTimer.h rename to ASTRA/lib/TeensyTimerTool-master/src/API/oneShotTimer.h diff --git a/lib/TeensyTimerTool-master/src/API/periodicTimer.h b/ASTRA/lib/TeensyTimerTool-master/src/API/periodicTimer.h similarity index 100% rename from lib/TeensyTimerTool-master/src/API/periodicTimer.h rename to ASTRA/lib/TeensyTimerTool-master/src/API/periodicTimer.h diff --git a/lib/TeensyTimerTool-master/src/API/timer.h b/ASTRA/lib/TeensyTimerTool-master/src/API/timer.h similarity index 100% rename from lib/TeensyTimerTool-master/src/API/timer.h rename to ASTRA/lib/TeensyTimerTool-master/src/API/timer.h diff --git a/lib/TeensyTimerTool-master/src/ErrorHandling/error_codes.h b/ASTRA/lib/TeensyTimerTool-master/src/ErrorHandling/error_codes.h similarity index 100% rename from lib/TeensyTimerTool-master/src/ErrorHandling/error_codes.h rename to ASTRA/lib/TeensyTimerTool-master/src/ErrorHandling/error_codes.h diff --git a/lib/TeensyTimerTool-master/src/ErrorHandling/error_handler.cpp b/ASTRA/lib/TeensyTimerTool-master/src/ErrorHandling/error_handler.cpp similarity index 100% rename from lib/TeensyTimerTool-master/src/ErrorHandling/error_handler.cpp rename to ASTRA/lib/TeensyTimerTool-master/src/ErrorHandling/error_handler.cpp diff --git a/lib/TeensyTimerTool-master/src/ErrorHandling/error_handler.h b/ASTRA/lib/TeensyTimerTool-master/src/ErrorHandling/error_handler.h similarity index 100% rename from lib/TeensyTimerTool-master/src/ErrorHandling/error_handler.h rename to ASTRA/lib/TeensyTimerTool-master/src/ErrorHandling/error_handler.h diff --git a/lib/TeensyTimerTool-master/src/ITimerChannel.h b/ASTRA/lib/TeensyTimerTool-master/src/ITimerChannel.h similarity index 100% rename from lib/TeensyTimerTool-master/src/ITimerChannel.h rename to ASTRA/lib/TeensyTimerTool-master/src/ITimerChannel.h diff --git a/lib/TeensyTimerTool-master/src/TeensyTimerTool.h b/ASTRA/lib/TeensyTimerTool-master/src/TeensyTimerTool.h similarity index 100% rename from lib/TeensyTimerTool-master/src/TeensyTimerTool.h rename to ASTRA/lib/TeensyTimerTool-master/src/TeensyTimerTool.h diff --git a/lib/TeensyTimerTool-master/src/TimerModules/FTM/FTM.h b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/FTM/FTM.h similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/FTM/FTM.h rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/FTM/FTM.h diff --git a/lib/TeensyTimerTool-master/src/TimerModules/FTM/FTM_Channel.h b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/FTM/FTM_Channel.h similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/FTM/FTM_Channel.h rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/FTM/FTM_Channel.h diff --git a/lib/TeensyTimerTool-master/src/TimerModules/FTM/FTM_ChannelInfo.h b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/FTM/FTM_ChannelInfo.h similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/FTM/FTM_ChannelInfo.h rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/FTM/FTM_ChannelInfo.h diff --git a/lib/TeensyTimerTool-master/src/TimerModules/FTM/FTM_Info.h b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/FTM/FTM_Info.h similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/FTM/FTM_Info.h rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/FTM/FTM_Info.h diff --git a/lib/TeensyTimerTool-master/src/TimerModules/GPT/GPT.h b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/GPT/GPT.h similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/GPT/GPT.h rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/GPT/GPT.h diff --git a/lib/TeensyTimerTool-master/src/TimerModules/GPT/GPTChannel.cpp b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/GPT/GPTChannel.cpp similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/GPT/GPTChannel.cpp rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/GPT/GPTChannel.cpp diff --git a/lib/TeensyTimerTool-master/src/TimerModules/GPT/GPTChannel.h b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/GPT/GPTChannel.h similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/GPT/GPTChannel.h rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/GPT/GPTChannel.h diff --git a/lib/TeensyTimerTool-master/src/TimerModules/GPT/GPTmap.h b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/GPT/GPTmap.h similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/GPT/GPTmap.h rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/GPT/GPTmap.h diff --git a/lib/TeensyTimerTool-master/src/TimerModules/PIT4/PIT.cpp b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/PIT4/PIT.cpp similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/PIT4/PIT.cpp rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/PIT4/PIT.cpp diff --git a/lib/TeensyTimerTool-master/src/TimerModules/PIT4/PIT.h b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/PIT4/PIT.h similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/PIT4/PIT.h rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/PIT4/PIT.h diff --git a/lib/TeensyTimerTool-master/src/TimerModules/PIT4/PITChannel.h b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/PIT4/PITChannel.h similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/PIT4/PITChannel.h rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/PIT4/PITChannel.h diff --git a/lib/TeensyTimerTool-master/src/TimerModules/TCK/TCK.cpp b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/TCK/TCK.cpp similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/TCK/TCK.cpp rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/TCK/TCK.cpp diff --git a/lib/TeensyTimerTool-master/src/TimerModules/TCK/TCK.h b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/TCK/TCK.h similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/TCK/TCK.h rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/TCK/TCK.h diff --git a/lib/TeensyTimerTool-master/src/TimerModules/TCK/TckChannel.h b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/TCK/TckChannel.h similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/TCK/TckChannel.h rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/TCK/TckChannel.h diff --git a/lib/TeensyTimerTool-master/src/TimerModules/TCK/TckChannelBase.cpp b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/TCK/TckChannelBase.cpp similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/TCK/TckChannelBase.cpp rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/TCK/TckChannelBase.cpp diff --git a/lib/TeensyTimerTool-master/src/TimerModules/TCK/TckChannelBase.h b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/TCK/TckChannelBase.h similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/TCK/TckChannelBase.h rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/TCK/TckChannelBase.h diff --git a/lib/TeensyTimerTool-master/src/TimerModules/TCK/tickCounters.cpp b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/TCK/tickCounters.cpp similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/TCK/tickCounters.cpp rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/TCK/tickCounters.cpp diff --git a/lib/TeensyTimerTool-master/src/TimerModules/TCK/tickCounters.h b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/TCK/tickCounters.h similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/TCK/tickCounters.h rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/TCK/tickCounters.h diff --git a/lib/TeensyTimerTool-master/src/TimerModules/TMR/TMR.h b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/TMR/TMR.h similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/TMR/TMR.h rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/TMR/TMR.h diff --git a/lib/TeensyTimerTool-master/src/TimerModules/TMR/TMRChannel.h b/ASTRA/lib/TeensyTimerTool-master/src/TimerModules/TMR/TMRChannel.h similarity index 100% rename from lib/TeensyTimerTool-master/src/TimerModules/TMR/TMRChannel.h rename to ASTRA/lib/TeensyTimerTool-master/src/TimerModules/TMR/TMRChannel.h diff --git a/lib/TeensyTimerTool-master/src/boardDef.h b/ASTRA/lib/TeensyTimerTool-master/src/boardDef.h similarity index 100% rename from lib/TeensyTimerTool-master/src/boardDef.h rename to ASTRA/lib/TeensyTimerTool-master/src/boardDef.h diff --git a/lib/TeensyTimerTool-master/src/config.cpp b/ASTRA/lib/TeensyTimerTool-master/src/config.cpp similarity index 100% rename from lib/TeensyTimerTool-master/src/config.cpp rename to ASTRA/lib/TeensyTimerTool-master/src/config.cpp diff --git a/lib/TeensyTimerTool-master/src/config.h b/ASTRA/lib/TeensyTimerTool-master/src/config.h similarity index 100% rename from lib/TeensyTimerTool-master/src/config.h rename to ASTRA/lib/TeensyTimerTool-master/src/config.h diff --git a/lib/TeensyTimerTool-master/src/defaultConfig.h b/ASTRA/lib/TeensyTimerTool-master/src/defaultConfig.h similarity index 100% rename from lib/TeensyTimerTool-master/src/defaultConfig.h rename to ASTRA/lib/TeensyTimerTool-master/src/defaultConfig.h diff --git a/lib/TeensyTimerTool-master/src/frequency.h.deactivated b/ASTRA/lib/TeensyTimerTool-master/src/frequency.h.deactivated similarity index 100% rename from lib/TeensyTimerTool-master/src/frequency.h.deactivated rename to ASTRA/lib/TeensyTimerTool-master/src/frequency.h.deactivated diff --git a/lib/TeensyTimerTool-master/src/helpers.h b/ASTRA/lib/TeensyTimerTool-master/src/helpers.h similarity index 100% rename from lib/TeensyTimerTool-master/src/helpers.h rename to ASTRA/lib/TeensyTimerTool-master/src/helpers.h diff --git a/lib/TeensyTimerTool-master/src/staticFunctional.h b/ASTRA/lib/TeensyTimerTool-master/src/staticFunctional.h similarity index 100% rename from lib/TeensyTimerTool-master/src/staticFunctional.h rename to ASTRA/lib/TeensyTimerTool-master/src/staticFunctional.h diff --git a/lib/TeensyTimerTool-master/src/types.h b/ASTRA/lib/TeensyTimerTool-master/src/types.h similarity index 100% rename from lib/TeensyTimerTool-master/src/types.h rename to ASTRA/lib/TeensyTimerTool-master/src/types.h diff --git a/lib/TeensyTimerTool-master/test/main.cpp b/ASTRA/lib/TeensyTimerTool-master/test/main.cpp similarity index 100% rename from lib/TeensyTimerTool-master/test/main.cpp rename to ASTRA/lib/TeensyTimerTool-master/test/main.cpp diff --git a/lib/teensyshot-master/.gitignore b/ASTRA/lib/teensyshot-master/.gitignore similarity index 100% rename from lib/teensyshot-master/.gitignore rename to ASTRA/lib/teensyshot-master/.gitignore diff --git a/lib/teensyshot-master/Arda/dma_v1.ino b/ASTRA/lib/teensyshot-master/Arda/dma_v1.ino similarity index 100% rename from lib/teensyshot-master/Arda/dma_v1.ino rename to ASTRA/lib/teensyshot-master/Arda/dma_v1.ino diff --git a/lib/teensyshot-master/Arda/dshot_simple_api/.gitignore b/ASTRA/lib/teensyshot-master/Arda/dshot_simple_api/.gitignore similarity index 100% rename from lib/teensyshot-master/Arda/dshot_simple_api/.gitignore rename to ASTRA/lib/teensyshot-master/Arda/dshot_simple_api/.gitignore diff --git a/lib/teensyshot-master/Arda/dshot_simple_api/include/dshot_api.h b/ASTRA/lib/teensyshot-master/Arda/dshot_simple_api/include/dshot_api.h similarity index 100% rename from lib/teensyshot-master/Arda/dshot_simple_api/include/dshot_api.h rename to ASTRA/lib/teensyshot-master/Arda/dshot_simple_api/include/dshot_api.h diff --git a/lib/teensyshot-master/Arda/dshot_simple_api/platformio.ini b/ASTRA/lib/teensyshot-master/Arda/dshot_simple_api/platformio.ini similarity index 100% rename from lib/teensyshot-master/Arda/dshot_simple_api/platformio.ini rename to ASTRA/lib/teensyshot-master/Arda/dshot_simple_api/platformio.ini diff --git a/lib/teensyshot-master/Arda/dshot_simple_api/src/dshot_api.cpp b/ASTRA/lib/teensyshot-master/Arda/dshot_simple_api/src/dshot_api.cpp similarity index 100% rename from lib/teensyshot-master/Arda/dshot_simple_api/src/dshot_api.cpp rename to ASTRA/lib/teensyshot-master/Arda/dshot_simple_api/src/dshot_api.cpp diff --git a/lib/teensyshot-master/Arda/dshot_simple_api/src/main.cpp b/ASTRA/lib/teensyshot-master/Arda/dshot_simple_api/src/main.cpp similarity index 100% rename from lib/teensyshot-master/Arda/dshot_simple_api/src/main.cpp rename to ASTRA/lib/teensyshot-master/Arda/dshot_simple_api/src/main.cpp diff --git a/lib/teensyshot-master/ESCPID/AWPID.cpp b/ASTRA/lib/teensyshot-master/ESCPID/AWPID.cpp similarity index 100% rename from lib/teensyshot-master/ESCPID/AWPID.cpp rename to ASTRA/lib/teensyshot-master/ESCPID/AWPID.cpp diff --git a/lib/teensyshot-master/ESCPID/AWPID.h b/ASTRA/lib/teensyshot-master/ESCPID/AWPID.h similarity index 100% rename from lib/teensyshot-master/ESCPID/AWPID.h rename to ASTRA/lib/teensyshot-master/ESCPID/AWPID.h diff --git a/lib/teensyshot-master/ESCPID/DSHOT.cpp b/ASTRA/lib/teensyshot-master/ESCPID/DSHOT.cpp similarity index 100% rename from lib/teensyshot-master/ESCPID/DSHOT.cpp rename to ASTRA/lib/teensyshot-master/ESCPID/DSHOT.cpp diff --git a/lib/teensyshot-master/ESCPID/DSHOT.h b/ASTRA/lib/teensyshot-master/ESCPID/DSHOT.h similarity index 100% rename from lib/teensyshot-master/ESCPID/DSHOT.h rename to ASTRA/lib/teensyshot-master/ESCPID/DSHOT.h diff --git a/lib/teensyshot-master/ESCPID/ESCCMD.cpp b/ASTRA/lib/teensyshot-master/ESCPID/ESCCMD.cpp similarity index 100% rename from lib/teensyshot-master/ESCPID/ESCCMD.cpp rename to ASTRA/lib/teensyshot-master/ESCPID/ESCCMD.cpp diff --git a/lib/teensyshot-master/ESCPID/ESCCMD.h b/ASTRA/lib/teensyshot-master/ESCPID/ESCCMD.h similarity index 100% rename from lib/teensyshot-master/ESCPID/ESCCMD.h rename to ASTRA/lib/teensyshot-master/ESCPID/ESCCMD.h diff --git a/lib/teensyshot-master/ESCPID/ESCPID.h b/ASTRA/lib/teensyshot-master/ESCPID/ESCPID.h similarity index 100% rename from lib/teensyshot-master/ESCPID/ESCPID.h rename to ASTRA/lib/teensyshot-master/ESCPID/ESCPID.h diff --git a/lib/teensyshot-master/ESCPID/ESCPID.ino b/ASTRA/lib/teensyshot-master/ESCPID/ESCPID.ino similarity index 100% rename from lib/teensyshot-master/ESCPID/ESCPID.ino rename to ASTRA/lib/teensyshot-master/ESCPID/ESCPID.ino diff --git a/lib/teensyshot-master/LICENSE b/ASTRA/lib/teensyshot-master/LICENSE similarity index 100% rename from lib/teensyshot-master/LICENSE rename to ASTRA/lib/teensyshot-master/LICENSE diff --git a/lib/teensyshot-master/README.md b/ASTRA/lib/teensyshot-master/README.md similarity index 100% rename from lib/teensyshot-master/README.md rename to ASTRA/lib/teensyshot-master/README.md diff --git a/lib/teensyshot-master/_config.yml b/ASTRA/lib/teensyshot-master/_config.yml similarity index 100% rename from lib/teensyshot-master/_config.yml rename to ASTRA/lib/teensyshot-master/_config.yml diff --git a/lib/teensyshot-master/docs/BLHeli32 cmd.pdf b/ASTRA/lib/teensyshot-master/docs/BLHeli32 cmd.pdf similarity index 100% rename from lib/teensyshot-master/docs/BLHeli32 cmd.pdf rename to ASTRA/lib/teensyshot-master/docs/BLHeli32 cmd.pdf diff --git a/lib/teensyshot-master/docs/K64P144M120SF5RM.pdf b/ASTRA/lib/teensyshot-master/docs/K64P144M120SF5RM.pdf similarity index 100% rename from lib/teensyshot-master/docs/K64P144M120SF5RM.pdf rename to ASTRA/lib/teensyshot-master/docs/K64P144M120SF5RM.pdf diff --git a/lib/teensyshot-master/docs/KISS_telemetry.pdf b/ASTRA/lib/teensyshot-master/docs/KISS_telemetry.pdf similarity index 100% rename from lib/teensyshot-master/docs/KISS_telemetry.pdf rename to ASTRA/lib/teensyshot-master/docs/KISS_telemetry.pdf diff --git a/lib/teensyshot-master/docs/PID AW explained.pdf b/ASTRA/lib/teensyshot-master/docs/PID AW explained.pdf similarity index 100% rename from lib/teensyshot-master/docs/PID AW explained.pdf rename to ASTRA/lib/teensyshot-master/docs/PID AW explained.pdf diff --git a/lib/teensyshot-master/docs/PID.pdf b/ASTRA/lib/teensyshot-master/docs/PID.pdf similarity index 100% rename from lib/teensyshot-master/docs/PID.pdf rename to ASTRA/lib/teensyshot-master/docs/PID.pdf diff --git a/lib/teensyshot-master/docs/RT1060.pdf b/ASTRA/lib/teensyshot-master/docs/RT1060.pdf similarity index 100% rename from lib/teensyshot-master/docs/RT1060.pdf rename to ASTRA/lib/teensyshot-master/docs/RT1060.pdf diff --git a/lib/teensyshot-master/docs/RT1060_eFlexPWM.pdf b/ASTRA/lib/teensyshot-master/docs/RT1060_eFlexPWM.pdf similarity index 100% rename from lib/teensyshot-master/docs/RT1060_eFlexPWM.pdf rename to ASTRA/lib/teensyshot-master/docs/RT1060_eFlexPWM.pdf diff --git a/lib/teensyshot-master/docs/RT1060_pin_mux.pdf b/ASTRA/lib/teensyshot-master/docs/RT1060_pin_mux.pdf similarity index 100% rename from lib/teensyshot-master/docs/RT1060_pin_mux.pdf rename to ASTRA/lib/teensyshot-master/docs/RT1060_pin_mux.pdf diff --git a/lib/teensyshot-master/host/host.c b/ASTRA/lib/teensyshot-master/host/host.c similarity index 100% rename from lib/teensyshot-master/host/host.c rename to ASTRA/lib/teensyshot-master/host/host.c diff --git a/lib/teensyshot-master/host/host.h b/ASTRA/lib/teensyshot-master/host/host.h similarity index 100% rename from lib/teensyshot-master/host/host.h rename to ASTRA/lib/teensyshot-master/host/host.h diff --git a/src/testing/DiyShot/.gitignore b/ASTRA/src/testing/DiyShot/.gitignore similarity index 100% rename from src/testing/DiyShot/.gitignore rename to ASTRA/src/testing/DiyShot/.gitignore diff --git a/src/testing/DiyShot/.vscode/extensions.json b/ASTRA/src/testing/DiyShot/.vscode/extensions.json similarity index 100% rename from src/testing/DiyShot/.vscode/extensions.json rename to ASTRA/src/testing/DiyShot/.vscode/extensions.json diff --git a/src/testing/DiyShot/include/README b/ASTRA/src/testing/DiyShot/include/README similarity index 100% rename from src/testing/DiyShot/include/README rename to ASTRA/src/testing/DiyShot/include/README diff --git a/src/testing/DiyShot/lib/README b/ASTRA/src/testing/DiyShot/lib/README similarity index 100% rename from src/testing/DiyShot/lib/README rename to ASTRA/src/testing/DiyShot/lib/README diff --git a/src/testing/DiyShot/platformio.ini b/ASTRA/src/testing/DiyShot/platformio.ini similarity index 100% rename from src/testing/DiyShot/platformio.ini rename to ASTRA/src/testing/DiyShot/platformio.ini diff --git a/src/testing/DiyShot/src/main.cpp b/ASTRA/src/testing/DiyShot/src/main.cpp similarity index 100% rename from src/testing/DiyShot/src/main.cpp rename to ASTRA/src/testing/DiyShot/src/main.cpp diff --git a/src/testing/DiyShot/test/README b/ASTRA/src/testing/DiyShot/test/README similarity index 100% rename from src/testing/DiyShot/test/README rename to ASTRA/src/testing/DiyShot/test/README diff --git a/src/testing/ESC_emulation_test/.gitignore b/ASTRA/src/testing/ESC_emulation_test/.gitignore similarity index 100% rename from src/testing/ESC_emulation_test/.gitignore rename to ASTRA/src/testing/ESC_emulation_test/.gitignore diff --git a/src/testing/ESC_emulation_test/.vscode/extensions.json b/ASTRA/src/testing/ESC_emulation_test/.vscode/extensions.json similarity index 100% rename from src/testing/ESC_emulation_test/.vscode/extensions.json rename to ASTRA/src/testing/ESC_emulation_test/.vscode/extensions.json diff --git a/src/testing/ESC_emulation_test/include/README b/ASTRA/src/testing/ESC_emulation_test/include/README similarity index 100% rename from src/testing/ESC_emulation_test/include/README rename to ASTRA/src/testing/ESC_emulation_test/include/README diff --git a/src/testing/ESC_emulation_test/lib/README b/ASTRA/src/testing/ESC_emulation_test/lib/README similarity index 100% rename from src/testing/ESC_emulation_test/lib/README rename to ASTRA/src/testing/ESC_emulation_test/lib/README diff --git a/src/testing/ESC_emulation_test/platformio.ini b/ASTRA/src/testing/ESC_emulation_test/platformio.ini similarity index 100% rename from src/testing/ESC_emulation_test/platformio.ini rename to ASTRA/src/testing/ESC_emulation_test/platformio.ini diff --git a/src/testing/ESC_emulation_test/src/main.cpp b/ASTRA/src/testing/ESC_emulation_test/src/main.cpp similarity index 100% rename from src/testing/ESC_emulation_test/src/main.cpp rename to ASTRA/src/testing/ESC_emulation_test/src/main.cpp diff --git a/src/testing/ESC_emulation_test/test/README b/ASTRA/src/testing/ESC_emulation_test/test/README similarity index 100% rename from src/testing/ESC_emulation_test/test/README rename to ASTRA/src/testing/ESC_emulation_test/test/README diff --git a/src/testing/servo_test_project/.gitignore b/ASTRA/src/testing/servo_test_project/.gitignore similarity index 100% rename from src/testing/servo_test_project/.gitignore rename to ASTRA/src/testing/servo_test_project/.gitignore diff --git a/src/testing/servo_test_project/.vscode/extensions.json b/ASTRA/src/testing/servo_test_project/.vscode/extensions.json similarity index 100% rename from src/testing/servo_test_project/.vscode/extensions.json rename to ASTRA/src/testing/servo_test_project/.vscode/extensions.json diff --git a/src/testing/servo_test_project/include/README b/ASTRA/src/testing/servo_test_project/include/README similarity index 100% rename from src/testing/servo_test_project/include/README rename to ASTRA/src/testing/servo_test_project/include/README diff --git a/src/testing/servo_test_project/lib/README b/ASTRA/src/testing/servo_test_project/lib/README similarity index 100% rename from src/testing/servo_test_project/lib/README rename to ASTRA/src/testing/servo_test_project/lib/README diff --git a/src/testing/servo_test_project/platformio.ini b/ASTRA/src/testing/servo_test_project/platformio.ini similarity index 100% rename from src/testing/servo_test_project/platformio.ini rename to ASTRA/src/testing/servo_test_project/platformio.ini diff --git a/src/testing/servo_test_project/src/main.cpp b/ASTRA/src/testing/servo_test_project/src/main.cpp similarity index 100% rename from src/testing/servo_test_project/src/main.cpp rename to ASTRA/src/testing/servo_test_project/src/main.cpp diff --git a/src/testing/servo_test_project/test/README b/ASTRA/src/testing/servo_test_project/test/README similarity index 100% rename from src/testing/servo_test_project/test/README rename to ASTRA/src/testing/servo_test_project/test/README diff --git a/README.md b/README.md index fb8eabf..9858d3a 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,19 @@ This Repo is organized into the following project folders: ASTRA, Lander, Ground_Station, and DAQ ## ASTRA +This Folder holds all code associated with the ASTRA project. -### /src ### /lib +/lib is a folder used for libraries and dependencies associated with the code in /src. +### /src +/src is a folder used for storing c++ files. Within /src you can find the following subfolders: +#### /IMU + +#### /Barometer + +#### /ESC + +#### /BMS ## Lander From ba736d12d4aff0671ee4811bd46badfa412a4bbd Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 3 Sep 2023 06:54:03 -0400 Subject: [PATCH 05/49] Added Logo To ReadMe --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9858d3a..b491426 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +![Logo](https://purdueseds.space/wp-content/uploads/2022/02/PSP-ActiveControls-1Color-White.svg) + # Active Controls Avionics Repository Welcome to the AC Avionics Repository! From 948fb08b0e8c2e1a8eb7d9a52c3f1d801a2c34f9 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 3 Sep 2023 06:57:00 -0400 Subject: [PATCH 06/49] Readme Update --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b491426..eea44a0 100644 --- a/README.md +++ b/README.md @@ -11,16 +11,16 @@ ASTRA, Lander, Ground_Station, and DAQ This Folder holds all code associated with the ASTRA project. ### /lib -/lib is a folder used for libraries and dependencies associated with the code in /src. +This folder is used for libraries and dependencies associated with the code in /src. ### /src -/src is a folder used for storing c++ files. Within /src you can find the following subfolders: -#### /IMU +This folder is used for storing c++ files. Within /src you can find the following subfolders: +### /IMU -#### /Barometer +#### /Barometer -#### /ESC +#### /ESC -#### /BMS +#### /BMS ## Lander From 0f782bb4292bc79927a7407e1bf573c233d644d9 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 3 Sep 2023 07:02:50 -0400 Subject: [PATCH 07/49] ReadMe Update --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index eea44a0..77c086e 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,13 @@ This Folder holds all code associated with the ASTRA project. This folder is used for libraries and dependencies associated with the code in /src. ### /src This folder is used for storing c++ files. Within /src you can find the following subfolders: -### /IMU + #### /IMU -#### /Barometer + #### /Barometer -#### /ESC + #### /ESC -#### /BMS + #### /BMS ## Lander From 43bf0bb75ce4ac3c72eb715d793be347e2ab6ce5 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 3 Sep 2023 07:09:08 -0400 Subject: [PATCH 08/49] Readme Update --- README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 77c086e..ac5988a 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,10 @@ This Folder holds all code associated with the ASTRA project. This folder is used for libraries and dependencies associated with the code in /src. ### /src This folder is used for storing c++ files. Within /src you can find the following subfolders: - #### /IMU - - #### /Barometer - - #### /ESC - - #### /BMS +* #### /IMU +#### /Barometer +#### /ESC +#### /BMS ## Lander From 8274f819be47b541e322e5231f9464ad9113ef6b Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 3 Sep 2023 07:11:07 -0400 Subject: [PATCH 09/49] Readme update --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ac5988a..3178c8f 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,13 @@ This folder is used for libraries and dependencies associated with the code in / ### /src This folder is used for storing c++ files. Within /src you can find the following subfolders: * #### /IMU -#### /Barometer -#### /ESC -#### /BMS + This folder is dedicated to IMU drivers +* #### /Barometer + This folder is dedicated to Barometer drivers +* #### /ESC + This folder is dedicated to ESC drivers +* #### /BMS + This folder is dedicated to BMS drivers ## Lander From b0731627c4e77b9f745bab5dd0da328aba8dfa22 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 3 Sep 2023 07:12:55 -0400 Subject: [PATCH 10/49] Updated Readme --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3178c8f..7e2a17e 100644 --- a/README.md +++ b/README.md @@ -25,18 +25,24 @@ This folder is used for storing c++ files. Within /src you can find the followin ## Lander -### /src ### /lib +This folder is used for libraries and dependencies associated with the code in /src. +### /src +This folder is used for storing c++ files. ## Ground_Station -### /src ### /lib +This folder is used for libraries and dependencies associated with the code in /src. +### /src +This folder is used for storing c++ files. ## DAQ -### /src ### /lib +This folder is used for libraries and dependencies associated with the code in /src. +### /src +This folder is used for storing c++ files. From 8dda8225a61adc9099fac2083a175fa6aa18b7e0 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 3 Sep 2023 07:14:25 -0400 Subject: [PATCH 11/49] ReadMe Update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7e2a17e..faac90e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This Repo is organized into the following project folders: ASTRA, Lander, Ground_Station, and DAQ ## ASTRA -This Folder holds all code associated with the ASTRA project. +This folder holds all low-level code associated with the ASTRA project. ### /lib This folder is used for libraries and dependencies associated with the code in /src. From afa1cb7abaf29c158cc016ecc2000461f337e3a2 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 3 Sep 2023 07:30:11 -0400 Subject: [PATCH 12/49] Updated ReadMe --- ASTRA/{src => }/testing/DiyShot/.gitignore | 0 .../testing/DiyShot/.vscode/extensions.json | 0 .../{src => }/testing/DiyShot/include/README | 0 ASTRA/{src => }/testing/DiyShot/lib/README | 0 .../{src => }/testing/DiyShot/platformio.ini | 0 ASTRA/{src => }/testing/DiyShot/src/main.cpp | 0 ASTRA/{src => }/testing/DiyShot/test/README | 0 .../testing/ESC_emulation_test/.gitignore | 0 .../.vscode/extensions.json | 0 .../testing/ESC_emulation_test/include/README | 0 .../testing/ESC_emulation_test/lib/README | 0 .../testing/ESC_emulation_test/platformio.ini | 0 .../testing/ESC_emulation_test/src/main.cpp | 0 .../testing/ESC_emulation_test/test/README | 0 .../testing/servo_test_project/.gitignore | 0 .../.vscode/extensions.json | 0 .../testing/servo_test_project/include/README | 0 .../testing/servo_test_project/lib/README | 0 .../testing/servo_test_project/platformio.ini | 0 .../testing/servo_test_project/src/main.cpp | 0 .../testing/servo_test_project/test/README | 0 README.md | 52 ++++++++----------- 22 files changed, 22 insertions(+), 30 deletions(-) rename ASTRA/{src => }/testing/DiyShot/.gitignore (100%) rename ASTRA/{src => }/testing/DiyShot/.vscode/extensions.json (100%) rename ASTRA/{src => }/testing/DiyShot/include/README (100%) rename ASTRA/{src => }/testing/DiyShot/lib/README (100%) rename ASTRA/{src => }/testing/DiyShot/platformio.ini (100%) rename ASTRA/{src => }/testing/DiyShot/src/main.cpp (100%) rename ASTRA/{src => }/testing/DiyShot/test/README (100%) rename ASTRA/{src => }/testing/ESC_emulation_test/.gitignore (100%) rename ASTRA/{src => }/testing/ESC_emulation_test/.vscode/extensions.json (100%) rename ASTRA/{src => }/testing/ESC_emulation_test/include/README (100%) rename ASTRA/{src => }/testing/ESC_emulation_test/lib/README (100%) rename ASTRA/{src => }/testing/ESC_emulation_test/platformio.ini (100%) rename ASTRA/{src => }/testing/ESC_emulation_test/src/main.cpp (100%) rename ASTRA/{src => }/testing/ESC_emulation_test/test/README (100%) rename ASTRA/{src => }/testing/servo_test_project/.gitignore (100%) rename ASTRA/{src => }/testing/servo_test_project/.vscode/extensions.json (100%) rename ASTRA/{src => }/testing/servo_test_project/include/README (100%) rename ASTRA/{src => }/testing/servo_test_project/lib/README (100%) rename ASTRA/{src => }/testing/servo_test_project/platformio.ini (100%) rename ASTRA/{src => }/testing/servo_test_project/src/main.cpp (100%) rename ASTRA/{src => }/testing/servo_test_project/test/README (100%) diff --git a/ASTRA/src/testing/DiyShot/.gitignore b/ASTRA/testing/DiyShot/.gitignore similarity index 100% rename from ASTRA/src/testing/DiyShot/.gitignore rename to ASTRA/testing/DiyShot/.gitignore diff --git a/ASTRA/src/testing/DiyShot/.vscode/extensions.json b/ASTRA/testing/DiyShot/.vscode/extensions.json similarity index 100% rename from ASTRA/src/testing/DiyShot/.vscode/extensions.json rename to ASTRA/testing/DiyShot/.vscode/extensions.json diff --git a/ASTRA/src/testing/DiyShot/include/README b/ASTRA/testing/DiyShot/include/README similarity index 100% rename from ASTRA/src/testing/DiyShot/include/README rename to ASTRA/testing/DiyShot/include/README diff --git a/ASTRA/src/testing/DiyShot/lib/README b/ASTRA/testing/DiyShot/lib/README similarity index 100% rename from ASTRA/src/testing/DiyShot/lib/README rename to ASTRA/testing/DiyShot/lib/README diff --git a/ASTRA/src/testing/DiyShot/platformio.ini b/ASTRA/testing/DiyShot/platformio.ini similarity index 100% rename from ASTRA/src/testing/DiyShot/platformio.ini rename to ASTRA/testing/DiyShot/platformio.ini diff --git a/ASTRA/src/testing/DiyShot/src/main.cpp b/ASTRA/testing/DiyShot/src/main.cpp similarity index 100% rename from ASTRA/src/testing/DiyShot/src/main.cpp rename to ASTRA/testing/DiyShot/src/main.cpp diff --git a/ASTRA/src/testing/DiyShot/test/README b/ASTRA/testing/DiyShot/test/README similarity index 100% rename from ASTRA/src/testing/DiyShot/test/README rename to ASTRA/testing/DiyShot/test/README diff --git a/ASTRA/src/testing/ESC_emulation_test/.gitignore b/ASTRA/testing/ESC_emulation_test/.gitignore similarity index 100% rename from ASTRA/src/testing/ESC_emulation_test/.gitignore rename to ASTRA/testing/ESC_emulation_test/.gitignore diff --git a/ASTRA/src/testing/ESC_emulation_test/.vscode/extensions.json b/ASTRA/testing/ESC_emulation_test/.vscode/extensions.json similarity index 100% rename from ASTRA/src/testing/ESC_emulation_test/.vscode/extensions.json rename to ASTRA/testing/ESC_emulation_test/.vscode/extensions.json diff --git a/ASTRA/src/testing/ESC_emulation_test/include/README b/ASTRA/testing/ESC_emulation_test/include/README similarity index 100% rename from ASTRA/src/testing/ESC_emulation_test/include/README rename to ASTRA/testing/ESC_emulation_test/include/README diff --git a/ASTRA/src/testing/ESC_emulation_test/lib/README b/ASTRA/testing/ESC_emulation_test/lib/README similarity index 100% rename from ASTRA/src/testing/ESC_emulation_test/lib/README rename to ASTRA/testing/ESC_emulation_test/lib/README diff --git a/ASTRA/src/testing/ESC_emulation_test/platformio.ini b/ASTRA/testing/ESC_emulation_test/platformio.ini similarity index 100% rename from ASTRA/src/testing/ESC_emulation_test/platformio.ini rename to ASTRA/testing/ESC_emulation_test/platformio.ini diff --git a/ASTRA/src/testing/ESC_emulation_test/src/main.cpp b/ASTRA/testing/ESC_emulation_test/src/main.cpp similarity index 100% rename from ASTRA/src/testing/ESC_emulation_test/src/main.cpp rename to ASTRA/testing/ESC_emulation_test/src/main.cpp diff --git a/ASTRA/src/testing/ESC_emulation_test/test/README b/ASTRA/testing/ESC_emulation_test/test/README similarity index 100% rename from ASTRA/src/testing/ESC_emulation_test/test/README rename to ASTRA/testing/ESC_emulation_test/test/README diff --git a/ASTRA/src/testing/servo_test_project/.gitignore b/ASTRA/testing/servo_test_project/.gitignore similarity index 100% rename from ASTRA/src/testing/servo_test_project/.gitignore rename to ASTRA/testing/servo_test_project/.gitignore diff --git a/ASTRA/src/testing/servo_test_project/.vscode/extensions.json b/ASTRA/testing/servo_test_project/.vscode/extensions.json similarity index 100% rename from ASTRA/src/testing/servo_test_project/.vscode/extensions.json rename to ASTRA/testing/servo_test_project/.vscode/extensions.json diff --git a/ASTRA/src/testing/servo_test_project/include/README b/ASTRA/testing/servo_test_project/include/README similarity index 100% rename from ASTRA/src/testing/servo_test_project/include/README rename to ASTRA/testing/servo_test_project/include/README diff --git a/ASTRA/src/testing/servo_test_project/lib/README b/ASTRA/testing/servo_test_project/lib/README similarity index 100% rename from ASTRA/src/testing/servo_test_project/lib/README rename to ASTRA/testing/servo_test_project/lib/README diff --git a/ASTRA/src/testing/servo_test_project/platformio.ini b/ASTRA/testing/servo_test_project/platformio.ini similarity index 100% rename from ASTRA/src/testing/servo_test_project/platformio.ini rename to ASTRA/testing/servo_test_project/platformio.ini diff --git a/ASTRA/src/testing/servo_test_project/src/main.cpp b/ASTRA/testing/servo_test_project/src/main.cpp similarity index 100% rename from ASTRA/src/testing/servo_test_project/src/main.cpp rename to ASTRA/testing/servo_test_project/src/main.cpp diff --git a/ASTRA/src/testing/servo_test_project/test/README b/ASTRA/testing/servo_test_project/test/README similarity index 100% rename from ASTRA/src/testing/servo_test_project/test/README rename to ASTRA/testing/servo_test_project/test/README diff --git a/README.md b/README.md index faac90e..2bae711 100644 --- a/README.md +++ b/README.md @@ -5,46 +5,38 @@ Welcome to the AC Avionics Repository! This Repo is organized into the following project folders: -ASTRA, Lander, Ground_Station, and DAQ +ASTRA, DAQ, Ground_Station, and Lander + +Most folders in this repository will have two subfolders: /src and /lib +#### /lib +This folder is used for libraries and dependencies associated with the code in /src. +#### /src +This folder is used for storing c++ files. Within /src you can find the following subfolders: ## ASTRA This folder holds all low-level code associated with the ASTRA project. -### /lib -This folder is used for libraries and dependencies associated with the code in /src. -### /src -This folder is used for storing c++ files. Within /src you can find the following subfolders: -* #### /IMU +### /IMU This folder is dedicated to IMU drivers -* #### /Barometer +### /Barometer This folder is dedicated to Barometer drivers -* #### /ESC +### /ESC This folder is dedicated to ESC drivers -* #### /BMS +### /BMS This folder is dedicated to BMS drivers -## Lander - -### /lib -This folder is used for libraries and dependencies associated with the code in /src. -### /src -This folder is used for storing c++ files. - -## Ground_Station - -### /lib -This folder is used for libraries and dependencies associated with the code in /src. -### /src -This folder is used for storing c++ files. - ## DAQ +This folder holds all code associated with test stands and setups that require data aquisition. -### /lib -This folder is used for libraries and dependencies associated with the code in /src. -### /src -This folder is used for storing c++ files. - - - +### /Thrust_Stand +This folder is dedicated to BMS drivers +### /Torque_Stand +This folder is dedicated to BMS drivers +### /Mag_Encoders +This folder is dedicated to BMS drivers +## Ground_Station +This folder holds all code associated with the Ground Base Station. +## Lander +This folder holds all low-level code associated with the Lander project. From afd6dd7a649fd9d61d3206f1e4baee9d52b4bb0c Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 3 Sep 2023 07:33:15 -0400 Subject: [PATCH 13/49] Updated ReadMe --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 2bae711..46d5c83 100644 --- a/README.md +++ b/README.md @@ -7,33 +7,33 @@ Welcome to the AC Avionics Repository! This Repo is organized into the following project folders: ASTRA, DAQ, Ground_Station, and Lander -Most folders in this repository will have two subfolders: /src and /lib +Most folders in this repository will have two subfolders: /lib and /src #### /lib This folder is used for libraries and dependencies associated with the code in /src. #### /src -This folder is used for storing c++ files. Within /src you can find the following subfolders: +This folder is used for storing c++ files. ## ASTRA This folder holds all low-level code associated with the ASTRA project. ### /IMU - This folder is dedicated to IMU drivers +This folder is dedicated to IMU drivers ### /Barometer - This folder is dedicated to Barometer drivers +This folder is dedicated to Barometer drivers ### /ESC - This folder is dedicated to ESC drivers +This folder is dedicated to ESC drivers ### /BMS - This folder is dedicated to BMS drivers +This folder is dedicated to BMS drivers ## DAQ This folder holds all code associated with test stands and setups that require data aquisition. ### /Thrust_Stand -This folder is dedicated to BMS drivers +This folder is dedicated to the Thrust Stand ### /Torque_Stand -This folder is dedicated to BMS drivers +This folder is dedicated to the Torque Stand ### /Mag_Encoders -This folder is dedicated to BMS drivers +This folder is dedicated to magnetic encoders ## Ground_Station This folder holds all code associated with the Ground Base Station. From 9830c833166d07ae553a0ec4d34e35887e13b979 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 3 Sep 2023 07:43:04 -0400 Subject: [PATCH 14/49] Readme Update and Reorganization --- {ASTRA => DAQ/Loadcell}/lib/HX711-master/.gitignore | 0 {ASTRA => DAQ/Loadcell}/lib/HX711-master/.travis.yml | 0 {ASTRA => DAQ/Loadcell}/lib/HX711-master/CMakeLists.txt | 0 {ASTRA => DAQ/Loadcell}/lib/HX711-master/CONTRIBUTORS.md | 0 {ASTRA => DAQ/Loadcell}/lib/HX711-master/LICENSE | 0 {ASTRA => DAQ/Loadcell}/lib/HX711-master/Makefile | 0 {ASTRA => DAQ/Loadcell}/lib/HX711-master/README.md | 0 {ASTRA => DAQ/Loadcell}/lib/HX711-master/doc/faq.md | 0 {ASTRA => DAQ/Loadcell}/lib/HX711-master/doc/notes.md | 0 .../Loadcell}/lib/HX711-master/doc/platformio-howto.md | 0 .../examples/HX711_basic_example/HX711_basic_example.ino | 0 .../examples/HX711_full_example/HX711_full_example.ino | 0 .../examples/HX711_retry_example/HX711_retry_example.ino | 0 .../examples/HX711_timeout_example/HX711_timeout_example.ino | 0 {ASTRA => DAQ/Loadcell}/lib/HX711-master/keywords.txt | 0 {ASTRA => DAQ/Loadcell}/lib/HX711-master/library.json | 0 {ASTRA => DAQ/Loadcell}/lib/HX711-master/library.properties | 0 {ASTRA => DAQ/Loadcell}/lib/HX711-master/platformio.ini | 0 {ASTRA => DAQ/Loadcell}/lib/HX711-master/src/HX711.cpp | 0 {ASTRA => DAQ/Loadcell}/lib/HX711-master/src/HX711.h | 0 README.md | 2 ++ 21 files changed, 2 insertions(+) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/.gitignore (100%) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/.travis.yml (100%) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/CMakeLists.txt (100%) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/CONTRIBUTORS.md (100%) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/LICENSE (100%) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/Makefile (100%) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/README.md (100%) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/doc/faq.md (100%) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/doc/notes.md (100%) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/doc/platformio-howto.md (100%) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/examples/HX711_basic_example/HX711_basic_example.ino (100%) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/examples/HX711_full_example/HX711_full_example.ino (100%) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/examples/HX711_retry_example/HX711_retry_example.ino (100%) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/examples/HX711_timeout_example/HX711_timeout_example.ino (100%) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/keywords.txt (100%) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/library.json (100%) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/library.properties (100%) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/platformio.ini (100%) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/src/HX711.cpp (100%) rename {ASTRA => DAQ/Loadcell}/lib/HX711-master/src/HX711.h (100%) diff --git a/ASTRA/lib/HX711-master/.gitignore b/DAQ/Loadcell/lib/HX711-master/.gitignore similarity index 100% rename from ASTRA/lib/HX711-master/.gitignore rename to DAQ/Loadcell/lib/HX711-master/.gitignore diff --git a/ASTRA/lib/HX711-master/.travis.yml b/DAQ/Loadcell/lib/HX711-master/.travis.yml similarity index 100% rename from ASTRA/lib/HX711-master/.travis.yml rename to DAQ/Loadcell/lib/HX711-master/.travis.yml diff --git a/ASTRA/lib/HX711-master/CMakeLists.txt b/DAQ/Loadcell/lib/HX711-master/CMakeLists.txt similarity index 100% rename from ASTRA/lib/HX711-master/CMakeLists.txt rename to DAQ/Loadcell/lib/HX711-master/CMakeLists.txt diff --git a/ASTRA/lib/HX711-master/CONTRIBUTORS.md b/DAQ/Loadcell/lib/HX711-master/CONTRIBUTORS.md similarity index 100% rename from ASTRA/lib/HX711-master/CONTRIBUTORS.md rename to DAQ/Loadcell/lib/HX711-master/CONTRIBUTORS.md diff --git a/ASTRA/lib/HX711-master/LICENSE b/DAQ/Loadcell/lib/HX711-master/LICENSE similarity index 100% rename from ASTRA/lib/HX711-master/LICENSE rename to DAQ/Loadcell/lib/HX711-master/LICENSE diff --git a/ASTRA/lib/HX711-master/Makefile b/DAQ/Loadcell/lib/HX711-master/Makefile similarity index 100% rename from ASTRA/lib/HX711-master/Makefile rename to DAQ/Loadcell/lib/HX711-master/Makefile diff --git a/ASTRA/lib/HX711-master/README.md b/DAQ/Loadcell/lib/HX711-master/README.md similarity index 100% rename from ASTRA/lib/HX711-master/README.md rename to DAQ/Loadcell/lib/HX711-master/README.md diff --git a/ASTRA/lib/HX711-master/doc/faq.md b/DAQ/Loadcell/lib/HX711-master/doc/faq.md similarity index 100% rename from ASTRA/lib/HX711-master/doc/faq.md rename to DAQ/Loadcell/lib/HX711-master/doc/faq.md diff --git a/ASTRA/lib/HX711-master/doc/notes.md b/DAQ/Loadcell/lib/HX711-master/doc/notes.md similarity index 100% rename from ASTRA/lib/HX711-master/doc/notes.md rename to DAQ/Loadcell/lib/HX711-master/doc/notes.md diff --git a/ASTRA/lib/HX711-master/doc/platformio-howto.md b/DAQ/Loadcell/lib/HX711-master/doc/platformio-howto.md similarity index 100% rename from ASTRA/lib/HX711-master/doc/platformio-howto.md rename to DAQ/Loadcell/lib/HX711-master/doc/platformio-howto.md diff --git a/ASTRA/lib/HX711-master/examples/HX711_basic_example/HX711_basic_example.ino b/DAQ/Loadcell/lib/HX711-master/examples/HX711_basic_example/HX711_basic_example.ino similarity index 100% rename from ASTRA/lib/HX711-master/examples/HX711_basic_example/HX711_basic_example.ino rename to DAQ/Loadcell/lib/HX711-master/examples/HX711_basic_example/HX711_basic_example.ino diff --git a/ASTRA/lib/HX711-master/examples/HX711_full_example/HX711_full_example.ino b/DAQ/Loadcell/lib/HX711-master/examples/HX711_full_example/HX711_full_example.ino similarity index 100% rename from ASTRA/lib/HX711-master/examples/HX711_full_example/HX711_full_example.ino rename to DAQ/Loadcell/lib/HX711-master/examples/HX711_full_example/HX711_full_example.ino diff --git a/ASTRA/lib/HX711-master/examples/HX711_retry_example/HX711_retry_example.ino b/DAQ/Loadcell/lib/HX711-master/examples/HX711_retry_example/HX711_retry_example.ino similarity index 100% rename from ASTRA/lib/HX711-master/examples/HX711_retry_example/HX711_retry_example.ino rename to DAQ/Loadcell/lib/HX711-master/examples/HX711_retry_example/HX711_retry_example.ino diff --git a/ASTRA/lib/HX711-master/examples/HX711_timeout_example/HX711_timeout_example.ino b/DAQ/Loadcell/lib/HX711-master/examples/HX711_timeout_example/HX711_timeout_example.ino similarity index 100% rename from ASTRA/lib/HX711-master/examples/HX711_timeout_example/HX711_timeout_example.ino rename to DAQ/Loadcell/lib/HX711-master/examples/HX711_timeout_example/HX711_timeout_example.ino diff --git a/ASTRA/lib/HX711-master/keywords.txt b/DAQ/Loadcell/lib/HX711-master/keywords.txt similarity index 100% rename from ASTRA/lib/HX711-master/keywords.txt rename to DAQ/Loadcell/lib/HX711-master/keywords.txt diff --git a/ASTRA/lib/HX711-master/library.json b/DAQ/Loadcell/lib/HX711-master/library.json similarity index 100% rename from ASTRA/lib/HX711-master/library.json rename to DAQ/Loadcell/lib/HX711-master/library.json diff --git a/ASTRA/lib/HX711-master/library.properties b/DAQ/Loadcell/lib/HX711-master/library.properties similarity index 100% rename from ASTRA/lib/HX711-master/library.properties rename to DAQ/Loadcell/lib/HX711-master/library.properties diff --git a/ASTRA/lib/HX711-master/platformio.ini b/DAQ/Loadcell/lib/HX711-master/platformio.ini similarity index 100% rename from ASTRA/lib/HX711-master/platformio.ini rename to DAQ/Loadcell/lib/HX711-master/platformio.ini diff --git a/ASTRA/lib/HX711-master/src/HX711.cpp b/DAQ/Loadcell/lib/HX711-master/src/HX711.cpp similarity index 100% rename from ASTRA/lib/HX711-master/src/HX711.cpp rename to DAQ/Loadcell/lib/HX711-master/src/HX711.cpp diff --git a/ASTRA/lib/HX711-master/src/HX711.h b/DAQ/Loadcell/lib/HX711-master/src/HX711.h similarity index 100% rename from ASTRA/lib/HX711-master/src/HX711.h rename to DAQ/Loadcell/lib/HX711-master/src/HX711.h diff --git a/README.md b/README.md index 46d5c83..8886976 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ This folder is dedicated to BMS drivers ## DAQ This folder holds all code associated with test stands and setups that require data aquisition. +### /Loadcell +This folder is dedicated to the -Insert Model Here- Loadcell ### /Thrust_Stand This folder is dedicated to the Thrust Stand ### /Torque_Stand From 2df87a360164f58b00663af1e507a2e884fd9054 Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 3 Sep 2023 07:44:15 -0400 Subject: [PATCH 15/49] Updated README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8886976..8346d2a 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@ This Repo is organized into the following project folders: ASTRA, DAQ, Ground_Station, and Lander Most folders in this repository will have two subfolders: /lib and /src -#### /lib +### /lib This folder is used for libraries and dependencies associated with the code in /src. -#### /src +### /src This folder is used for storing c++ files. ## ASTRA From ab0852d1e31a7dee7f710b9701f208efdb7ad828 Mon Sep 17 00:00:00 2001 From: Vincent Palmerio Date: Sat, 21 Oct 2023 13:42:57 -0400 Subject: [PATCH 16/49] converted to platformio project --- .pio/build/project.checksum | 1 + .pio/build/teensy41/idedata.json | 1 + .../Adafruit BusIO/.github/ISSUE_TEMPLATE.md | 46 + .../.github/PULL_REQUEST_TEMPLATE.md | 26 + .../.github/workflows/githubci.yml | 33 + .pio/libdeps/teensy41/Adafruit BusIO/.piopm | 1 + .../Adafruit_BusIO_Register.cpp | 365 +++++++ .../Adafruit BusIO/Adafruit_BusIO_Register.h | 105 ++ .../Adafruit BusIO/Adafruit_I2CDevice.cpp | 317 +++++++ .../Adafruit BusIO/Adafruit_I2CDevice.h | 36 + .../Adafruit BusIO/Adafruit_I2CRegister.h | 10 + .../Adafruit BusIO/Adafruit_SPIDevice.cpp | 508 ++++++++++ .../Adafruit BusIO/Adafruit_SPIDevice.h | 142 +++ .../teensy41/Adafruit BusIO/CMakeLists.txt | 11 + .pio/libdeps/teensy41/Adafruit BusIO/LICENSE | 21 + .../libdeps/teensy41/Adafruit BusIO/README.md | 8 + .../teensy41/Adafruit BusIO/component.mk | 1 + .../i2c_address_detect/i2c_address_detect.ino | 21 + .../examples/i2c_readwrite/i2c_readwrite.ino | 41 + .../examples/i2c_registers/i2c_registers.ino | 38 + .../i2corspi_register/i2corspi_register.ino | 38 + .../examples/spi_modetest/spi_modetest.ino | 29 + .../examples/spi_readwrite/spi_readwrite.ino | 39 + .../spi_register_bits/spi_register_bits.ino | 192 ++++ .../examples/spi_registers/spi_registers.ino | 34 + .../Adafruit BusIO/library.properties | 9 + .../Adafruit LSM6DS/.github/ISSUE_TEMPLATE.md | 46 + .../.github/PULL_REQUEST_TEMPLATE.md | 26 + .../.github/workflows/githubci.yml | 32 + .../teensy41/Adafruit LSM6DS/.gitignore | 5 + .pio/libdeps/teensy41/Adafruit LSM6DS/.piopm | 1 + .../Adafruit LSM6DS/Adafruit_ISM330DHCX.cpp | 35 + .../Adafruit LSM6DS/Adafruit_ISM330DHCX.h | 38 + .../Adafruit LSM6DS/Adafruit_LSM6DS.cpp | 895 ++++++++++++++++++ .../Adafruit LSM6DS/Adafruit_LSM6DS.h | 251 +++++ .../Adafruit LSM6DS/Adafruit_LSM6DS3.cpp | 51 + .../Adafruit LSM6DS/Adafruit_LSM6DS3.h | 42 + .../Adafruit LSM6DS/Adafruit_LSM6DS33.cpp | 40 + .../Adafruit LSM6DS/Adafruit_LSM6DS33.h | 38 + .../Adafruit LSM6DS/Adafruit_LSM6DS3TRC.cpp | 71 ++ .../Adafruit LSM6DS/Adafruit_LSM6DS3TRC.h | 43 + .../Adafruit LSM6DS/Adafruit_LSM6DSL.cpp | 49 + .../Adafruit LSM6DS/Adafruit_LSM6DSL.h | 42 + .../Adafruit LSM6DS/Adafruit_LSM6DSO32.cpp | 143 +++ .../Adafruit LSM6DS/Adafruit_LSM6DSO32.h | 49 + .../Adafruit LSM6DS/Adafruit_LSM6DSOX.cpp | 90 ++ .../Adafruit LSM6DS/Adafruit_LSM6DSOX.h | 53 ++ .../teensy41/Adafruit LSM6DS/README.md | 35 + .../Adafruit LSM6DS/code-of-conduct.md | 127 +++ .../adafruit_ism330dhcx_test.ino | 198 ++++ .../adafruit_lsm6ds33_test.ino | 197 ++++ .../adafruit_lsm6ds3trc_test.ino | 198 ++++ .../adafruit_lsm6ds_pedometer.ino | 52 + .../adafruit_lsm6ds_shake.ino | 44 + .../adafruit_lsm6ds_unifiedsensors.ino | 85 ++ .../adafruit_lsm6dso32_test.ino | 196 ++++ .../adafruit_lsm6dsox_test.ino | 196 ++++ .../Adafruit LSM6DS/library.properties | 10 + .../teensy41/Adafruit LSM6DS/license.txt | 26 + .../Adafruit Unified Sensor/.gitignore | 108 +++ .../Adafruit_Sensor.cpp | 120 +++ .../Adafruit Unified Sensor/Adafruit_Sensor.h | 224 +++++ .../Adafruit Unified Sensor/LICENSE.txt | 202 ++++ .../Adafruit Unified Sensor/README.md | 271 ++++++ .../examples/sensortest/sensortest.ino | 153 +++ .../library.properties | 11 + .pio/libdeps/teensy41/integrity.dat | 1 + .vscode/c_cpp_properties.json | 252 ++++- .vscode/extensions.json | 10 + .vscode/launch.json | 44 + ASTRA/IMU/lib/src/IMU.h | 2 + include/README | 39 + lib/README | 46 + platformio.ini | 15 + test/README | 11 + 75 files changed, 6977 insertions(+), 9 deletions(-) create mode 100644 .pio/build/project.checksum create mode 100644 .pio/build/teensy41/idedata.json create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/.github/ISSUE_TEMPLATE.md create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/.github/PULL_REQUEST_TEMPLATE.md create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/.github/workflows/githubci.yml create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/.piopm create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/Adafruit_BusIO_Register.cpp create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/Adafruit_BusIO_Register.h create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CDevice.cpp create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CDevice.h create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CRegister.h create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/Adafruit_SPIDevice.cpp create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/Adafruit_SPIDevice.h create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/CMakeLists.txt create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/LICENSE create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/README.md create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/component.mk create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_address_detect/i2c_address_detect.ino create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_readwrite/i2c_readwrite.ino create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_registers/i2c_registers.ino create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/examples/i2corspi_register/i2corspi_register.ino create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/examples/spi_modetest/spi_modetest.ino create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/examples/spi_readwrite/spi_readwrite.ino create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/examples/spi_register_bits/spi_register_bits.ino create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/examples/spi_registers/spi_registers.ino create mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/library.properties create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/.github/ISSUE_TEMPLATE.md create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/.github/PULL_REQUEST_TEMPLATE.md create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/.github/workflows/githubci.yml create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/.gitignore create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/.piopm create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_ISM330DHCX.cpp create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_ISM330DHCX.h create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS.cpp create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS.h create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3.cpp create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3.h create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS33.cpp create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS33.h create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3TRC.cpp create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3TRC.h create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSL.cpp create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSL.h create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSO32.cpp create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSO32.h create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSOX.cpp create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSOX.h create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/README.md create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/code-of-conduct.md create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_ism330dhcx_test/adafruit_ism330dhcx_test.ino create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds33_test/adafruit_lsm6ds33_test.ino create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds3trc_test/adafruit_lsm6ds3trc_test.ino create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_pedometer/adafruit_lsm6ds_pedometer.ino create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_shake/adafruit_lsm6ds_shake.ino create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_unifiedsensors/adafruit_lsm6ds_unifiedsensors.ino create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6dso32_test/adafruit_lsm6dso32_test.ino create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6dsox_test/adafruit_lsm6dsox_test.ino create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/library.properties create mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/license.txt create mode 100644 .pio/libdeps/teensy41/Adafruit Unified Sensor/.gitignore create mode 100644 .pio/libdeps/teensy41/Adafruit Unified Sensor/Adafruit_Sensor.cpp create mode 100644 .pio/libdeps/teensy41/Adafruit Unified Sensor/Adafruit_Sensor.h create mode 100644 .pio/libdeps/teensy41/Adafruit Unified Sensor/LICENSE.txt create mode 100644 .pio/libdeps/teensy41/Adafruit Unified Sensor/README.md create mode 100644 .pio/libdeps/teensy41/Adafruit Unified Sensor/examples/sensortest/sensortest.ino create mode 100644 .pio/libdeps/teensy41/Adafruit Unified Sensor/library.properties create mode 100644 .pio/libdeps/teensy41/integrity.dat create mode 100644 .vscode/extensions.json create mode 100644 .vscode/launch.json create mode 100644 ASTRA/IMU/lib/src/IMU.h create mode 100644 include/README create mode 100644 lib/README create mode 100644 platformio.ini create mode 100644 test/README diff --git a/.pio/build/project.checksum b/.pio/build/project.checksum new file mode 100644 index 0000000..39b25ff --- /dev/null +++ b/.pio/build/project.checksum @@ -0,0 +1 @@ +74370b8e1512dbd1be4c1bdbf600b2258108a598 \ No newline at end of file diff --git a/.pio/build/teensy41/idedata.json b/.pio/build/teensy41/idedata.json new file mode 100644 index 0000000..06b806d --- /dev/null +++ b/.pio/build/teensy41/idedata.json @@ -0,0 +1 @@ +{"build_type": "release", "env_name": "teensy41", "libsource_dirs": ["/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/lib", "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41", "/Users/vpalmerio/.platformio/lib", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries"], "defines": ["PLATFORMIO=60111", "__IMXRT1062__", "ARDUINO_TEENSY41", "USB_SERIAL", "ARDUINO=10805", "TEENSYDUINO=158", "CORE_TEENSY", "F_CPU=600000000", "LAYOUT_US_ENGLISH"], "includes": {"build": ["/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/include", "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/src", "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/include", "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/src", "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit LSM6DS", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/cores/teensy4"], "compatlib": ["/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit BusIO", "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit LSM6DS", "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit Unified Sensor", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPI", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire/utility", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ADC", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AccelStepper/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_NeoPixel", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_STMPE610", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_VS1053", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001/utility", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AltSoftSerial", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Artnet", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio/utility", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce2/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CapacitiveSensor", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CryptoAccel/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DS1307RTC", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DmxSimple", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DogLcd", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EEPROM", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransfer/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransferI2C/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder/utility", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Entropy", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ethernet/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FNET/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastCRC", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastLED/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN_T4", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexIO_t4/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexiTimer2", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqCount", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasure", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasureMulti", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FrequencyTimer2", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9341_t3", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9488_t3/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/IRremote/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Keypad/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedControl/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedDisplay", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystal/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystalFast", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LittleFS/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LowPower", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MFRC522/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MIDI/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Metro", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MsTimer2", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense/utility", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NativeEthernet/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OSC", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OctoWS2811", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OneWire", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard/utility", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PWMServo", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ping", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PulsePosition", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/QuadEncoder", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RA8875/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RadioHead", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ResponsiveAnalogRead/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SD/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPIFlash", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ST7735_t3/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SdFat/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SerialFlash", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Servo", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ShiftPWM", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Snooze/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftPWM", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftwareSerial", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TFT_ILI9163C", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Talkie", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TeensyThreads", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Time", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimeAlarms", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerOne", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerThree", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TinyGPS", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Tlc5940", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TouchScreen", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36/utility", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/UTFT", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/VirtualWire", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/WS2812Serial", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XBee", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XPT2046_Touchscreen", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/i2c_t3", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ks0108", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ssd1351", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/x10"], "toolchain": ["/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1", "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi", "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include", "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed", "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include"]}, "cc_flags": ["-Wall", "-ffunction-sections", "-fdata-sections", "-mthumb", "-mcpu=cortex-m7", "-nostdlib", "-mfloat-abi=hard", "-mfpu=fpv5-d16", "-O2"], "cxx_flags": ["-fno-exceptions", "-felide-constructors", "-fno-rtti", "-std=gnu++14", "-Wno-error=narrowing", "-fpermissive", "-fno-threadsafe-statics", "-Wall", "-ffunction-sections", "-fdata-sections", "-mthumb", "-mcpu=cortex-m7", "-nostdlib", "-mfloat-abi=hard", "-mfpu=fpv5-d16", "-O2"], "cc_path": "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc", "cxx_path": "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++", "gdb_path": "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gdb", "prog_path": "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/build/teensy41/firmware.elf", "svd_path": null, "compiler_type": "gcc", "targets": [{"name": "upload", "group": "Platform", "title": "Upload"}], "extra": {"flash_images": []}} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/.github/ISSUE_TEMPLATE.md b/.pio/libdeps/teensy41/Adafruit BusIO/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..f0e2614 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,46 @@ +Thank you for opening an issue on an Adafruit Arduino library repository. To +improve the speed of resolution please review the following guidelines and +common troubleshooting steps below before creating the issue: + +- **Do not use GitHub issues for troubleshooting projects and issues.** Instead use + the forums at http://forums.adafruit.com to ask questions and troubleshoot why + something isn't working as expected. In many cases the problem is a common issue + that you will more quickly receive help from the forum community. GitHub issues + are meant for known defects in the code. If you don't know if there is a defect + in the code then start with troubleshooting on the forum first. + +- **If following a tutorial or guide be sure you didn't miss a step.** Carefully + check all of the steps and commands to run have been followed. Consult the + forum if you're unsure or have questions about steps in a guide/tutorial. + +- **For Arduino projects check these very common issues to ensure they don't apply**: + + - For uploading sketches or communicating with the board make sure you're using + a **USB data cable** and **not** a **USB charge-only cable**. It is sometimes + very hard to tell the difference between a data and charge cable! Try using the + cable with other devices or swapping to another cable to confirm it is not + the problem. + + - **Be sure you are supplying adequate power to the board.** Check the specs of + your board and plug in an external power supply. In many cases just + plugging a board into your computer is not enough to power it and other + peripherals. + + - **Double check all soldering joints and connections.** Flakey connections + cause many mysterious problems. See the [guide to excellent soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering/tools) for examples of good solder joints. + + - **Ensure you are using an official Arduino or Adafruit board.** We can't + guarantee a clone board will have the same functionality and work as expected + with this code and don't support them. + +If you're sure this issue is a defect in the code and checked the steps above +please fill in the following fields to provide enough troubleshooting information. +You may delete the guideline and text above to just leave the following details: + +- Arduino board: **INSERT ARDUINO BOARD NAME/TYPE HERE** + +- Arduino IDE version (found in Arduino -> About Arduino menu): **INSERT ARDUINO + VERSION HERE** + +- List the steps to reproduce the problem below (if possible attach a sketch or + copy the sketch code in too): **LIST REPRO STEPS BELOW** diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/.github/PULL_REQUEST_TEMPLATE.md b/.pio/libdeps/teensy41/Adafruit BusIO/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..7b641eb --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,26 @@ +Thank you for creating a pull request to contribute to Adafruit's GitHub code! +Before you open the request please review the following guidelines and tips to +help it be more easily integrated: + +- **Describe the scope of your change--i.e. what the change does and what parts + of the code were modified.** This will help us understand any risks of integrating + the code. + +- **Describe any known limitations with your change.** For example if the change + doesn't apply to a supported platform of the library please mention it. + +- **Please run any tests or examples that can exercise your modified code.** We + strive to not break users of the code and running tests/examples helps with this + process. + +Thank you again for contributing! We will try to test and integrate the change +as soon as we can, but be aware we have many GitHub repositories to manage and +can't immediately respond to every request. There is no need to bump or check in +on a pull request (it will clutter the discussion of the request). + +Also don't be worried if the request is closed or not integrated--sometimes the +priorities of Adafruit's GitHub code (education, ease of use) might not match the +priorities of the pull request. Don't fret, the open source community thrives on +forks and GitHub makes it easy to keep your changes in a forked repo. + +After reviewing the guidelines above you can delete this text from the pull request. diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/.github/workflows/githubci.yml b/.pio/libdeps/teensy41/Adafruit BusIO/.github/workflows/githubci.yml new file mode 100644 index 0000000..8a57d75 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/.github/workflows/githubci.yml @@ -0,0 +1,33 @@ +name: Arduino Library CI + +on: [pull_request, push, repository_dispatch] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/setup-python@v4 + with: + python-version: '3.x' + - uses: actions/checkout@v3 + - uses: actions/checkout@v3 + with: + repository: adafruit/ci-arduino + path: ci + + - name: Install the prerequisites + run: bash ci/actions_install.sh + + - name: Check for correct code formatting with clang-format + run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r . + + - name: Check for correct documentation with doxygen + env: + GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }} + PRETTYNAME : "Adafruit Bus IO Library" + run: bash ci/doxy_gen_and_deploy.sh + + - name: Test the code on supported platforms + run: python3 ci/build_platform.py main_platforms zero feather32u4 + diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/.piopm b/.pio/libdeps/teensy41/Adafruit BusIO/.piopm new file mode 100644 index 0000000..35c04c9 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/.piopm @@ -0,0 +1 @@ +{"type": "library", "name": "Adafruit BusIO", "version": "1.14.5", "spec": {"owner": "adafruit", "id": 6214, "name": "Adafruit BusIO", "requirements": null, "uri": null}} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_BusIO_Register.cpp b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_BusIO_Register.cpp new file mode 100644 index 0000000..a28193f --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_BusIO_Register.cpp @@ -0,0 +1,365 @@ +#include + +#if !defined(SPI_INTERFACES_COUNT) || \ + (defined(SPI_INTERFACES_COUNT) && (SPI_INTERFACES_COUNT > 0)) + +/*! + * @brief Create a register we access over an I2C Device (which defines the + * bus and address) + * @param i2cdevice The I2CDevice to use for underlying I2C access + * @param reg_addr The address pointer value for the I2C/SMBus register, can + * be 8 or 16 bits + * @param width The width of the register data itself, defaults to 1 byte + * @param byteorder The byte order of the register (used when width is > 1), + * defaults to LSBFIRST + * @param address_width The width of the register address itself, defaults + * to 1 byte + */ +Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, + uint16_t reg_addr, + uint8_t width, + uint8_t byteorder, + uint8_t address_width) { + _i2cdevice = i2cdevice; + _spidevice = nullptr; + _addrwidth = address_width; + _address = reg_addr; + _byteorder = byteorder; + _width = width; +} + +/*! + * @brief Create a register we access over an SPI Device (which defines the + * bus and CS pin) + * @param spidevice The SPIDevice to use for underlying SPI access + * @param reg_addr The address pointer value for the SPI register, can + * be 8 or 16 bits + * @param type The method we use to read/write data to SPI (which is not + * as well defined as I2C) + * @param width The width of the register data itself, defaults to 1 byte + * @param byteorder The byte order of the register (used when width is > 1), + * defaults to LSBFIRST + * @param address_width The width of the register address itself, defaults + * to 1 byte + */ +Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_SPIDevice *spidevice, + uint16_t reg_addr, + Adafruit_BusIO_SPIRegType type, + uint8_t width, + uint8_t byteorder, + uint8_t address_width) { + _spidevice = spidevice; + _spiregtype = type; + _i2cdevice = nullptr; + _addrwidth = address_width; + _address = reg_addr; + _byteorder = byteorder; + _width = width; +} + +/*! + * @brief Create a register we access over an I2C or SPI Device. This is a + * handy function because we can pass in nullptr for the unused interface, + * allowing libraries to mass-define all the registers + * @param i2cdevice The I2CDevice to use for underlying I2C access, if + * nullptr we use SPI + * @param spidevice The SPIDevice to use for underlying SPI access, if + * nullptr we use I2C + * @param reg_addr The address pointer value for the I2C/SMBus/SPI register, + * can be 8 or 16 bits + * @param type The method we use to read/write data to SPI (which is not + * as well defined as I2C) + * @param width The width of the register data itself, defaults to 1 byte + * @param byteorder The byte order of the register (used when width is > 1), + * defaults to LSBFIRST + * @param address_width The width of the register address itself, defaults + * to 1 byte + */ +Adafruit_BusIO_Register::Adafruit_BusIO_Register( + Adafruit_I2CDevice *i2cdevice, Adafruit_SPIDevice *spidevice, + Adafruit_BusIO_SPIRegType type, uint16_t reg_addr, uint8_t width, + uint8_t byteorder, uint8_t address_width) { + _spidevice = spidevice; + _i2cdevice = i2cdevice; + _spiregtype = type; + _addrwidth = address_width; + _address = reg_addr; + _byteorder = byteorder; + _width = width; +} + +/*! + * @brief Write a buffer of data to the register location + * @param buffer Pointer to data to write + * @param len Number of bytes to write + * @return True on successful write (only really useful for I2C as SPI is + * uncheckable) + */ +bool Adafruit_BusIO_Register::write(uint8_t *buffer, uint8_t len) { + + uint8_t addrbuffer[2] = {(uint8_t)(_address & 0xFF), + (uint8_t)(_address >> 8)}; + + if (_i2cdevice) { + return _i2cdevice->write(buffer, len, true, addrbuffer, _addrwidth); + } + if (_spidevice) { + if (_spiregtype == ADDRESSED_OPCODE_BIT0_LOW_TO_WRITE) { + // very special case! + + // pass the special opcode address which we set as the high byte of the + // regaddr + addrbuffer[0] = + (uint8_t)(_address >> 8) & ~0x01; // set bottom bit low to write + // the 'actual' reg addr is the second byte then + addrbuffer[1] = (uint8_t)(_address & 0xFF); + // the address appears to be a byte longer + return _spidevice->write(buffer, len, addrbuffer, _addrwidth + 1); + } + + if (_spiregtype == ADDRBIT8_HIGH_TOREAD) { + addrbuffer[0] &= ~0x80; + } + if (_spiregtype == ADDRBIT8_HIGH_TOWRITE) { + addrbuffer[0] |= 0x80; + } + if (_spiregtype == AD8_HIGH_TOREAD_AD7_HIGH_TOINC) { + addrbuffer[0] &= ~0x80; + addrbuffer[0] |= 0x40; + } + return _spidevice->write(buffer, len, addrbuffer, _addrwidth); + } + return false; +} + +/*! + * @brief Write up to 4 bytes of data to the register location + * @param value Data to write + * @param numbytes How many bytes from 'value' to write + * @return True on successful write (only really useful for I2C as SPI is + * uncheckable) + */ +bool Adafruit_BusIO_Register::write(uint32_t value, uint8_t numbytes) { + if (numbytes == 0) { + numbytes = _width; + } + if (numbytes > 4) { + return false; + } + + // store a copy + _cached = value; + + for (int i = 0; i < numbytes; i++) { + if (_byteorder == LSBFIRST) { + _buffer[i] = value & 0xFF; + } else { + _buffer[numbytes - i - 1] = value & 0xFF; + } + value >>= 8; + } + return write(_buffer, numbytes); +} + +/*! + * @brief Read data from the register location. This does not do any error + * checking! + * @return Returns 0xFFFFFFFF on failure, value otherwise + */ +uint32_t Adafruit_BusIO_Register::read(void) { + if (!read(_buffer, _width)) { + return -1; + } + + uint32_t value = 0; + + for (int i = 0; i < _width; i++) { + value <<= 8; + if (_byteorder == LSBFIRST) { + value |= _buffer[_width - i - 1]; + } else { + value |= _buffer[i]; + } + } + + return value; +} + +/*! + * @brief Read cached data from last time we wrote to this register + * @return Returns 0xFFFFFFFF on failure, value otherwise + */ +uint32_t Adafruit_BusIO_Register::readCached(void) { return _cached; } + +/*! + * @brief Read a buffer of data from the register location + * @param buffer Pointer to data to read into + * @param len Number of bytes to read + * @return True on successful write (only really useful for I2C as SPI is + * uncheckable) + */ +bool Adafruit_BusIO_Register::read(uint8_t *buffer, uint8_t len) { + uint8_t addrbuffer[2] = {(uint8_t)(_address & 0xFF), + (uint8_t)(_address >> 8)}; + + if (_i2cdevice) { + return _i2cdevice->write_then_read(addrbuffer, _addrwidth, buffer, len); + } + if (_spidevice) { + if (_spiregtype == ADDRESSED_OPCODE_BIT0_LOW_TO_WRITE) { + // very special case! + + // pass the special opcode address which we set as the high byte of the + // regaddr + addrbuffer[0] = + (uint8_t)(_address >> 8) | 0x01; // set bottom bit high to read + // the 'actual' reg addr is the second byte then + addrbuffer[1] = (uint8_t)(_address & 0xFF); + // the address appears to be a byte longer + return _spidevice->write_then_read(addrbuffer, _addrwidth + 1, buffer, + len); + } + if (_spiregtype == ADDRBIT8_HIGH_TOREAD) { + addrbuffer[0] |= 0x80; + } + if (_spiregtype == ADDRBIT8_HIGH_TOWRITE) { + addrbuffer[0] &= ~0x80; + } + if (_spiregtype == AD8_HIGH_TOREAD_AD7_HIGH_TOINC) { + addrbuffer[0] |= 0x80 | 0x40; + } + return _spidevice->write_then_read(addrbuffer, _addrwidth, buffer, len); + } + return false; +} + +/*! + * @brief Read 2 bytes of data from the register location + * @param value Pointer to uint16_t variable to read into + * @return True on successful write (only really useful for I2C as SPI is + * uncheckable) + */ +bool Adafruit_BusIO_Register::read(uint16_t *value) { + if (!read(_buffer, 2)) { + return false; + } + + if (_byteorder == LSBFIRST) { + *value = _buffer[1]; + *value <<= 8; + *value |= _buffer[0]; + } else { + *value = _buffer[0]; + *value <<= 8; + *value |= _buffer[1]; + } + return true; +} + +/*! + * @brief Read 1 byte of data from the register location + * @param value Pointer to uint8_t variable to read into + * @return True on successful write (only really useful for I2C as SPI is + * uncheckable) + */ +bool Adafruit_BusIO_Register::read(uint8_t *value) { + if (!read(_buffer, 1)) { + return false; + } + + *value = _buffer[0]; + return true; +} + +/*! + * @brief Pretty printer for this register + * @param s The Stream to print to, defaults to &Serial + */ +void Adafruit_BusIO_Register::print(Stream *s) { + uint32_t val = read(); + s->print("0x"); + s->print(val, HEX); +} + +/*! + * @brief Pretty printer for this register + * @param s The Stream to print to, defaults to &Serial + */ +void Adafruit_BusIO_Register::println(Stream *s) { + print(s); + s->println(); +} + +/*! + * @brief Create a slice of the register that we can address without + * touching other bits + * @param reg The Adafruit_BusIO_Register which defines the bus/register + * @param bits The number of bits wide we are slicing + * @param shift The number of bits that our bit-slice is shifted from LSB + */ +Adafruit_BusIO_RegisterBits::Adafruit_BusIO_RegisterBits( + Adafruit_BusIO_Register *reg, uint8_t bits, uint8_t shift) { + _register = reg; + _bits = bits; + _shift = shift; +} + +/*! + * @brief Read 4 bytes of data from the register + * @return data The 4 bytes to read + */ +uint32_t Adafruit_BusIO_RegisterBits::read(void) { + uint32_t val = _register->read(); + val >>= _shift; + return val & ((1 << (_bits)) - 1); +} + +/*! + * @brief Write 4 bytes of data to the register + * @param data The 4 bytes to write + * @return True on successful write (only really useful for I2C as SPI is + * uncheckable) + */ +bool Adafruit_BusIO_RegisterBits::write(uint32_t data) { + uint32_t val = _register->read(); + + // mask off the data before writing + uint32_t mask = (1 << (_bits)) - 1; + data &= mask; + + mask <<= _shift; + val &= ~mask; // remove the current data at that spot + val |= data << _shift; // and add in the new data + + return _register->write(val, _register->width()); +} + +/*! + * @brief The width of the register data, helpful for doing calculations + * @returns The data width used when initializing the register + */ +uint8_t Adafruit_BusIO_Register::width(void) { return _width; } + +/*! + * @brief Set the default width of data + * @param width the default width of data read from register + */ +void Adafruit_BusIO_Register::setWidth(uint8_t width) { _width = width; } + +/*! + * @brief Set register address + * @param address the address from register + */ +void Adafruit_BusIO_Register::setAddress(uint16_t address) { + _address = address; +} + +/*! + * @brief Set the width of register address + * @param address_width the width for register address + */ +void Adafruit_BusIO_Register::setAddressWidth(uint16_t address_width) { + _addrwidth = address_width; +} + +#endif // SPI exists diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_BusIO_Register.h b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_BusIO_Register.h new file mode 100644 index 0000000..c6d58de --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_BusIO_Register.h @@ -0,0 +1,105 @@ +#ifndef Adafruit_BusIO_Register_h +#define Adafruit_BusIO_Register_h + +#include + +#if !defined(SPI_INTERFACES_COUNT) || \ + (defined(SPI_INTERFACES_COUNT) && (SPI_INTERFACES_COUNT > 0)) + +#include +#include + +typedef enum _Adafruit_BusIO_SPIRegType { + ADDRBIT8_HIGH_TOREAD = 0, + /*!< + * ADDRBIT8_HIGH_TOREAD + * When reading a register you must actually send the value 0x80 + register + * address to the device. e.g. To read the register 0x0B the register value + * 0x8B is sent and to write 0x0B is sent. + */ + AD8_HIGH_TOREAD_AD7_HIGH_TOINC = 1, + + /*!< + * ADDRBIT8_HIGH_TOWRITE + * When writing to a register you must actually send the value 0x80 + + * the register address to the device. e.g. To write to the register 0x19 the + * register value 0x99 is sent and to read 0x19 is sent. + */ + ADDRBIT8_HIGH_TOWRITE = 2, + + /*!< + * ADDRESSED_OPCODE_LOWBIT_TO_WRITE + * Used by the MCP23S series, we send 0x40 |'rd with the opcode + * Then set the lowest bit to write + */ + ADDRESSED_OPCODE_BIT0_LOW_TO_WRITE = 3, + +} Adafruit_BusIO_SPIRegType; + +/*! + * @brief The class which defines a device register (a location to read/write + * data from) + */ +class Adafruit_BusIO_Register { +public: + Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, uint16_t reg_addr, + uint8_t width = 1, uint8_t byteorder = LSBFIRST, + uint8_t address_width = 1); + + Adafruit_BusIO_Register(Adafruit_SPIDevice *spidevice, uint16_t reg_addr, + Adafruit_BusIO_SPIRegType type, uint8_t width = 1, + uint8_t byteorder = LSBFIRST, + uint8_t address_width = 1); + + Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, + Adafruit_SPIDevice *spidevice, + Adafruit_BusIO_SPIRegType type, uint16_t reg_addr, + uint8_t width = 1, uint8_t byteorder = LSBFIRST, + uint8_t address_width = 1); + + bool read(uint8_t *buffer, uint8_t len); + bool read(uint8_t *value); + bool read(uint16_t *value); + uint32_t read(void); + uint32_t readCached(void); + bool write(uint8_t *buffer, uint8_t len); + bool write(uint32_t value, uint8_t numbytes = 0); + + uint8_t width(void); + + void setWidth(uint8_t width); + void setAddress(uint16_t address); + void setAddressWidth(uint16_t address_width); + + void print(Stream *s = &Serial); + void println(Stream *s = &Serial); + +private: + Adafruit_I2CDevice *_i2cdevice; + Adafruit_SPIDevice *_spidevice; + Adafruit_BusIO_SPIRegType _spiregtype; + uint16_t _address; + uint8_t _width, _addrwidth, _byteorder; + uint8_t _buffer[4]; // we won't support anything larger than uint32 for + // non-buffered read + uint32_t _cached = 0; +}; + +/*! + * @brief The class which defines a slice of bits from within a device register + * (a location to read/write data from) + */ +class Adafruit_BusIO_RegisterBits { +public: + Adafruit_BusIO_RegisterBits(Adafruit_BusIO_Register *reg, uint8_t bits, + uint8_t shift); + bool write(uint32_t value); + uint32_t read(void); + +private: + Adafruit_BusIO_Register *_register; + uint8_t _bits, _shift; +}; + +#endif // SPI exists +#endif // BusIO_Register_h diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CDevice.cpp b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CDevice.cpp new file mode 100644 index 0000000..92c1731 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CDevice.cpp @@ -0,0 +1,317 @@ +#include "Adafruit_I2CDevice.h" + +//#define DEBUG_SERIAL Serial + +/*! + * @brief Create an I2C device at a given address + * @param addr The 7-bit I2C address for the device + * @param theWire The I2C bus to use, defaults to &Wire + */ +Adafruit_I2CDevice::Adafruit_I2CDevice(uint8_t addr, TwoWire *theWire) { + _addr = addr; + _wire = theWire; + _begun = false; +#ifdef ARDUINO_ARCH_SAMD + _maxBufferSize = 250; // as defined in Wire.h's RingBuffer +#elif defined(ESP32) + _maxBufferSize = I2C_BUFFER_LENGTH; +#else + _maxBufferSize = 32; +#endif +} + +/*! + * @brief Initializes and does basic address detection + * @param addr_detect Whether we should attempt to detect the I2C address + * with a scan. 99% of sensors/devices don't mind, but once in a while they + * don't respond well to a scan! + * @return True if I2C initialized and a device with the addr found + */ +bool Adafruit_I2CDevice::begin(bool addr_detect) { + _wire->begin(); + _begun = true; + + if (addr_detect) { + return detected(); + } + return true; +} + +/*! + * @brief De-initialize device, turn off the Wire interface + */ +void Adafruit_I2CDevice::end(void) { + // Not all port implement Wire::end(), such as + // - ESP8266 + // - AVR core without WIRE_HAS_END + // - ESP32: end() is implemented since 2.0.1 which is latest at the moment. + // Temporarily disable for now to give time for user to update. +#if !(defined(ESP8266) || \ + (defined(ARDUINO_ARCH_AVR) && !defined(WIRE_HAS_END)) || \ + defined(ARDUINO_ARCH_ESP32)) + _wire->end(); + _begun = false; +#endif +} + +/*! + * @brief Scans I2C for the address - note will give a false-positive + * if there's no pullups on I2C + * @return True if I2C initialized and a device with the addr found + */ +bool Adafruit_I2CDevice::detected(void) { + // Init I2C if not done yet + if (!_begun && !begin()) { + return false; + } + + // A basic scanner, see if it ACK's + _wire->beginTransmission(_addr); +#ifdef DEBUG_SERIAL + DEBUG_SERIAL.print(F("Address 0x")); + DEBUG_SERIAL.print(_addr); +#endif + if (_wire->endTransmission() == 0) { +#ifdef DEBUG_SERIAL + DEBUG_SERIAL.println(F(" Detected")); +#endif + return true; + } +#ifdef DEBUG_SERIAL + DEBUG_SERIAL.println(F(" Not detected")); +#endif + return false; +} + +/*! + * @brief Write a buffer or two to the I2C device. Cannot be more than + * maxBufferSize() bytes. + * @param buffer Pointer to buffer of data to write. This is const to + * ensure the content of this buffer doesn't change. + * @param len Number of bytes from buffer to write + * @param prefix_buffer Pointer to optional array of data to write before + * buffer. Cannot be more than maxBufferSize() bytes. This is const to + * ensure the content of this buffer doesn't change. + * @param prefix_len Number of bytes from prefix buffer to write + * @param stop Whether to send an I2C STOP signal on write + * @return True if write was successful, otherwise false. + */ +bool Adafruit_I2CDevice::write(const uint8_t *buffer, size_t len, bool stop, + const uint8_t *prefix_buffer, + size_t prefix_len) { + if ((len + prefix_len) > maxBufferSize()) { + // currently not guaranteed to work if more than 32 bytes! + // we will need to find out if some platforms have larger + // I2C buffer sizes :/ +#ifdef DEBUG_SERIAL + DEBUG_SERIAL.println(F("\tI2CDevice could not write such a large buffer")); +#endif + return false; + } + + _wire->beginTransmission(_addr); + + // Write the prefix data (usually an address) + if ((prefix_len != 0) && (prefix_buffer != nullptr)) { + if (_wire->write(prefix_buffer, prefix_len) != prefix_len) { +#ifdef DEBUG_SERIAL + DEBUG_SERIAL.println(F("\tI2CDevice failed to write")); +#endif + return false; + } + } + + // Write the data itself + if (_wire->write(buffer, len) != len) { +#ifdef DEBUG_SERIAL + DEBUG_SERIAL.println(F("\tI2CDevice failed to write")); +#endif + return false; + } + +#ifdef DEBUG_SERIAL + + DEBUG_SERIAL.print(F("\tI2CWRITE @ 0x")); + DEBUG_SERIAL.print(_addr, HEX); + DEBUG_SERIAL.print(F(" :: ")); + if ((prefix_len != 0) && (prefix_buffer != nullptr)) { + for (uint16_t i = 0; i < prefix_len; i++) { + DEBUG_SERIAL.print(F("0x")); + DEBUG_SERIAL.print(prefix_buffer[i], HEX); + DEBUG_SERIAL.print(F(", ")); + } + } + for (uint16_t i = 0; i < len; i++) { + DEBUG_SERIAL.print(F("0x")); + DEBUG_SERIAL.print(buffer[i], HEX); + DEBUG_SERIAL.print(F(", ")); + if (i % 32 == 31) { + DEBUG_SERIAL.println(); + } + } + + if (stop) { + DEBUG_SERIAL.print("\tSTOP"); + } +#endif + + if (_wire->endTransmission(stop) == 0) { +#ifdef DEBUG_SERIAL + DEBUG_SERIAL.println(); + // DEBUG_SERIAL.println("Sent!"); +#endif + return true; + } else { +#ifdef DEBUG_SERIAL + DEBUG_SERIAL.println("\tFailed to send!"); +#endif + return false; + } +} + +/*! + * @brief Read from I2C into a buffer from the I2C device. + * Cannot be more than maxBufferSize() bytes. + * @param buffer Pointer to buffer of data to read into + * @param len Number of bytes from buffer to read. + * @param stop Whether to send an I2C STOP signal on read + * @return True if read was successful, otherwise false. + */ +bool Adafruit_I2CDevice::read(uint8_t *buffer, size_t len, bool stop) { + size_t pos = 0; + while (pos < len) { + size_t read_len = + ((len - pos) > maxBufferSize()) ? maxBufferSize() : (len - pos); + bool read_stop = (pos < (len - read_len)) ? false : stop; + if (!_read(buffer + pos, read_len, read_stop)) + return false; + pos += read_len; + } + return true; +} + +bool Adafruit_I2CDevice::_read(uint8_t *buffer, size_t len, bool stop) { +#if defined(TinyWireM_h) + size_t recv = _wire->requestFrom((uint8_t)_addr, (uint8_t)len); +#elif defined(ARDUINO_ARCH_MEGAAVR) + size_t recv = _wire->requestFrom(_addr, len, stop); +#else + size_t recv = _wire->requestFrom((uint8_t)_addr, (uint8_t)len, (uint8_t)stop); +#endif + + if (recv != len) { + // Not enough data available to fulfill our obligation! +#ifdef DEBUG_SERIAL + DEBUG_SERIAL.print(F("\tI2CDevice did not receive enough data: ")); + DEBUG_SERIAL.println(recv); +#endif + return false; + } + + for (uint16_t i = 0; i < len; i++) { + buffer[i] = _wire->read(); + } + +#ifdef DEBUG_SERIAL + DEBUG_SERIAL.print(F("\tI2CREAD @ 0x")); + DEBUG_SERIAL.print(_addr, HEX); + DEBUG_SERIAL.print(F(" :: ")); + for (uint16_t i = 0; i < len; i++) { + DEBUG_SERIAL.print(F("0x")); + DEBUG_SERIAL.print(buffer[i], HEX); + DEBUG_SERIAL.print(F(", ")); + if (len % 32 == 31) { + DEBUG_SERIAL.println(); + } + } + DEBUG_SERIAL.println(); +#endif + + return true; +} + +/*! + * @brief Write some data, then read some data from I2C into another buffer. + * Cannot be more than maxBufferSize() bytes. The buffers can point to + * same/overlapping locations. + * @param write_buffer Pointer to buffer of data to write from + * @param write_len Number of bytes from buffer to write. + * @param read_buffer Pointer to buffer of data to read into. + * @param read_len Number of bytes from buffer to read. + * @param stop Whether to send an I2C STOP signal between the write and read + * @return True if write & read was successful, otherwise false. + */ +bool Adafruit_I2CDevice::write_then_read(const uint8_t *write_buffer, + size_t write_len, uint8_t *read_buffer, + size_t read_len, bool stop) { + if (!write(write_buffer, write_len, stop)) { + return false; + } + + return read(read_buffer, read_len); +} + +/*! + * @brief Returns the 7-bit address of this device + * @return The 7-bit address of this device + */ +uint8_t Adafruit_I2CDevice::address(void) { return _addr; } + +/*! + * @brief Change the I2C clock speed to desired (relies on + * underlying Wire support! + * @param desiredclk The desired I2C SCL frequency + * @return True if this platform supports changing I2C speed. + * Not necessarily that the speed was achieved! + */ +bool Adafruit_I2CDevice::setSpeed(uint32_t desiredclk) { +#if defined(__AVR_ATmega328__) || \ + defined(__AVR_ATmega328P__) // fix arduino core set clock + // calculate TWBR correctly + + if ((F_CPU / 18) < desiredclk) { +#ifdef DEBUG_SERIAL + Serial.println(F("I2C.setSpeed too high.")); +#endif + return false; + } + uint32_t atwbr = ((F_CPU / desiredclk) - 16) / 2; + if (atwbr > 16320) { +#ifdef DEBUG_SERIAL + Serial.println(F("I2C.setSpeed too low.")); +#endif + return false; + } + + if (atwbr <= 255) { + atwbr /= 1; + TWSR = 0x0; + } else if (atwbr <= 1020) { + atwbr /= 4; + TWSR = 0x1; + } else if (atwbr <= 4080) { + atwbr /= 16; + TWSR = 0x2; + } else { // if (atwbr <= 16320) + atwbr /= 64; + TWSR = 0x3; + } + TWBR = atwbr; + +#ifdef DEBUG_SERIAL + Serial.print(F("TWSR prescaler = ")); + Serial.println(pow(4, TWSR)); + Serial.print(F("TWBR = ")); + Serial.println(atwbr); +#endif + return true; +#elif (ARDUINO >= 157) && !defined(ARDUINO_STM32_FEATHER) && \ + !defined(TinyWireM_h) + _wire->setClock(desiredclk); + return true; + +#else + (void)desiredclk; + return false; +#endif +} diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CDevice.h b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CDevice.h new file mode 100644 index 0000000..6bda7ba --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CDevice.h @@ -0,0 +1,36 @@ +#ifndef Adafruit_I2CDevice_h +#define Adafruit_I2CDevice_h + +#include +#include + +///< The class which defines how we will talk to this device over I2C +class Adafruit_I2CDevice { +public: + Adafruit_I2CDevice(uint8_t addr, TwoWire *theWire = &Wire); + uint8_t address(void); + bool begin(bool addr_detect = true); + void end(void); + bool detected(void); + + bool read(uint8_t *buffer, size_t len, bool stop = true); + bool write(const uint8_t *buffer, size_t len, bool stop = true, + const uint8_t *prefix_buffer = nullptr, size_t prefix_len = 0); + bool write_then_read(const uint8_t *write_buffer, size_t write_len, + uint8_t *read_buffer, size_t read_len, + bool stop = false); + bool setSpeed(uint32_t desiredclk); + + /*! @brief How many bytes we can read in a transaction + * @return The size of the Wire receive/transmit buffer */ + size_t maxBufferSize() { return _maxBufferSize; } + +private: + uint8_t _addr; + TwoWire *_wire; + bool _begun; + size_t _maxBufferSize; + bool _read(uint8_t *buffer, size_t len, bool stop); +}; + +#endif // Adafruit_I2CDevice_h diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CRegister.h b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CRegister.h new file mode 100644 index 0000000..186850f --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CRegister.h @@ -0,0 +1,10 @@ +#ifndef _ADAFRUIT_I2C_REGISTER_H_ +#define _ADAFRUIT_I2C_REGISTER_H_ + +#include +#include + +typedef Adafruit_BusIO_Register Adafruit_I2CRegister; +typedef Adafruit_BusIO_RegisterBits Adafruit_I2CRegisterBits; + +#endif diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_SPIDevice.cpp b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_SPIDevice.cpp new file mode 100644 index 0000000..034dc08 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_SPIDevice.cpp @@ -0,0 +1,508 @@ +#include "Adafruit_SPIDevice.h" + +//#define DEBUG_SERIAL Serial + +/*! + * @brief Create an SPI device with the given CS pin and settings + * @param cspin The arduino pin number to use for chip select + * @param freq The SPI clock frequency to use, defaults to 1MHz + * @param dataOrder The SPI data order to use for bits within each byte, + * defaults to SPI_BITORDER_MSBFIRST + * @param dataMode The SPI mode to use, defaults to SPI_MODE0 + * @param theSPI The SPI bus to use, defaults to &theSPI + */ +Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t cspin, uint32_t freq, + BusIOBitOrder dataOrder, + uint8_t dataMode, SPIClass *theSPI) { +#ifdef BUSIO_HAS_HW_SPI + _cs = cspin; + _sck = _mosi = _miso = -1; + _spi = theSPI; + _begun = false; + _spiSetting = new SPISettings(freq, dataOrder, dataMode); + _freq = freq; + _dataOrder = dataOrder; + _dataMode = dataMode; +#else + // unused, but needed to suppress compiler warns + (void)cspin; + (void)freq; + (void)dataOrder; + (void)dataMode; + (void)theSPI; +#endif +} + +/*! + * @brief Create an SPI device with the given CS pin and settings + * @param cspin The arduino pin number to use for chip select + * @param sckpin The arduino pin number to use for SCK + * @param misopin The arduino pin number to use for MISO, set to -1 if not + * used + * @param mosipin The arduino pin number to use for MOSI, set to -1 if not + * used + * @param freq The SPI clock frequency to use, defaults to 1MHz + * @param dataOrder The SPI data order to use for bits within each byte, + * defaults to SPI_BITORDER_MSBFIRST + * @param dataMode The SPI mode to use, defaults to SPI_MODE0 + */ +Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t cspin, int8_t sckpin, + int8_t misopin, int8_t mosipin, + uint32_t freq, BusIOBitOrder dataOrder, + uint8_t dataMode) { + _cs = cspin; + _sck = sckpin; + _miso = misopin; + _mosi = mosipin; + +#ifdef BUSIO_USE_FAST_PINIO + csPort = (BusIO_PortReg *)portOutputRegister(digitalPinToPort(cspin)); + csPinMask = digitalPinToBitMask(cspin); + if (mosipin != -1) { + mosiPort = (BusIO_PortReg *)portOutputRegister(digitalPinToPort(mosipin)); + mosiPinMask = digitalPinToBitMask(mosipin); + } + if (misopin != -1) { + misoPort = (BusIO_PortReg *)portInputRegister(digitalPinToPort(misopin)); + misoPinMask = digitalPinToBitMask(misopin); + } + clkPort = (BusIO_PortReg *)portOutputRegister(digitalPinToPort(sckpin)); + clkPinMask = digitalPinToBitMask(sckpin); +#endif + + _freq = freq; + _dataOrder = dataOrder; + _dataMode = dataMode; + _begun = false; +} + +/*! + * @brief Release memory allocated in constructors + */ +Adafruit_SPIDevice::~Adafruit_SPIDevice() { + if (_spiSetting) + delete _spiSetting; +} + +/*! + * @brief Initializes SPI bus and sets CS pin high + * @return Always returns true because there's no way to test success of SPI + * init + */ +bool Adafruit_SPIDevice::begin(void) { + if (_cs != -1) { + pinMode(_cs, OUTPUT); + digitalWrite(_cs, HIGH); + } + + if (_spi) { // hardware SPI +#ifdef BUSIO_HAS_HW_SPI + _spi->begin(); +#endif + } else { + pinMode(_sck, OUTPUT); + + if ((_dataMode == SPI_MODE0) || (_dataMode == SPI_MODE1)) { + // idle low on mode 0 and 1 + digitalWrite(_sck, LOW); + } else { + // idle high on mode 2 or 3 + digitalWrite(_sck, HIGH); + } + if (_mosi != -1) { + pinMode(_mosi, OUTPUT); + digitalWrite(_mosi, HIGH); + } + if (_miso != -1) { + pinMode(_miso, INPUT); + } + } + + _begun = true; + return true; +} + +/*! + * @brief Transfer (send/receive) a buffer over hard/soft SPI, without + * transaction management + * @param buffer The buffer to send and receive at the same time + * @param len The number of bytes to transfer + */ +void Adafruit_SPIDevice::transfer(uint8_t *buffer, size_t len) { + // + // HARDWARE SPI + // + if (_spi) { +#ifdef BUSIO_HAS_HW_SPI +#if defined(SPARK) + _spi->transfer(buffer, buffer, len, nullptr); +#elif defined(STM32) + for (size_t i = 0; i < len; i++) { + _spi->transfer(buffer[i]); + } +#else + _spi->transfer(buffer, len); +#endif + return; +#endif + } + + // + // SOFTWARE SPI + // + uint8_t startbit; + if (_dataOrder == SPI_BITORDER_LSBFIRST) { + startbit = 0x1; + } else { + startbit = 0x80; + } + + bool towrite, lastmosi = !(buffer[0] & startbit); + uint8_t bitdelay_us = (1000000 / _freq) / 2; + + for (size_t i = 0; i < len; i++) { + uint8_t reply = 0; + uint8_t send = buffer[i]; + + /* + Serial.print("\tSending software SPI byte 0x"); + Serial.print(send, HEX); + Serial.print(" -> 0x"); + */ + + // Serial.print(send, HEX); + for (uint8_t b = startbit; b != 0; + b = (_dataOrder == SPI_BITORDER_LSBFIRST) ? b << 1 : b >> 1) { + + if (bitdelay_us) { + delayMicroseconds(bitdelay_us); + } + + if (_dataMode == SPI_MODE0 || _dataMode == SPI_MODE2) { + towrite = send & b; + if ((_mosi != -1) && (lastmosi != towrite)) { +#ifdef BUSIO_USE_FAST_PINIO + if (towrite) + *mosiPort = *mosiPort | mosiPinMask; + else + *mosiPort = *mosiPort & ~mosiPinMask; +#else + digitalWrite(_mosi, towrite); +#endif + lastmosi = towrite; + } + +#ifdef BUSIO_USE_FAST_PINIO + *clkPort = *clkPort | clkPinMask; // Clock high +#else + digitalWrite(_sck, HIGH); +#endif + + if (bitdelay_us) { + delayMicroseconds(bitdelay_us); + } + + if (_miso != -1) { +#ifdef BUSIO_USE_FAST_PINIO + if (*misoPort & misoPinMask) { +#else + if (digitalRead(_miso)) { +#endif + reply |= b; + } + } + +#ifdef BUSIO_USE_FAST_PINIO + *clkPort = *clkPort & ~clkPinMask; // Clock low +#else + digitalWrite(_sck, LOW); +#endif + } else { // if (_dataMode == SPI_MODE1 || _dataMode == SPI_MODE3) + +#ifdef BUSIO_USE_FAST_PINIO + *clkPort = *clkPort | clkPinMask; // Clock high +#else + digitalWrite(_sck, HIGH); +#endif + + if (bitdelay_us) { + delayMicroseconds(bitdelay_us); + } + + if (_mosi != -1) { +#ifdef BUSIO_USE_FAST_PINIO + if (send & b) + *mosiPort = *mosiPort | mosiPinMask; + else + *mosiPort = *mosiPort & ~mosiPinMask; +#else + digitalWrite(_mosi, send & b); +#endif + } + +#ifdef BUSIO_USE_FAST_PINIO + *clkPort = *clkPort & ~clkPinMask; // Clock low +#else + digitalWrite(_sck, LOW); +#endif + + if (_miso != -1) { +#ifdef BUSIO_USE_FAST_PINIO + if (*misoPort & misoPinMask) { +#else + if (digitalRead(_miso)) { +#endif + reply |= b; + } + } + } + if (_miso != -1) { + buffer[i] = reply; + } + } + } + return; +} + +/*! + * @brief Transfer (send/receive) one byte over hard/soft SPI, without + * transaction management + * @param send The byte to send + * @return The byte received while transmitting + */ +uint8_t Adafruit_SPIDevice::transfer(uint8_t send) { + uint8_t data = send; + transfer(&data, 1); + return data; +} + +/*! + * @brief Manually begin a transaction (calls beginTransaction if hardware + * SPI) + */ +void Adafruit_SPIDevice::beginTransaction(void) { + if (_spi) { +#ifdef BUSIO_HAS_HW_SPI + _spi->beginTransaction(*_spiSetting); +#endif + } +} + +/*! + * @brief Manually end a transaction (calls endTransaction if hardware SPI) + */ +void Adafruit_SPIDevice::endTransaction(void) { + if (_spi) { +#ifdef BUSIO_HAS_HW_SPI + _spi->endTransaction(); +#endif + } +} + +/*! + * @brief Assert/Deassert the CS pin if it is defined + * @param value The state the CS is set to + */ +void Adafruit_SPIDevice::setChipSelect(int value) { + if (_cs != -1) { + digitalWrite(_cs, value); + } +} + +/*! + * @brief Write a buffer or two to the SPI device, with transaction + * management. + * @brief Manually begin a transaction (calls beginTransaction if hardware + * SPI) with asserting the CS pin + */ +void Adafruit_SPIDevice::beginTransactionWithAssertingCS() { + beginTransaction(); + setChipSelect(LOW); +} + +/*! + * @brief Manually end a transaction (calls endTransaction if hardware SPI) + * with deasserting the CS pin + */ +void Adafruit_SPIDevice::endTransactionWithDeassertingCS() { + setChipSelect(HIGH); + endTransaction(); +} + +/*! + * @brief Write a buffer or two to the SPI device, with transaction + * management. + * @param buffer Pointer to buffer of data to write + * @param len Number of bytes from buffer to write + * @param prefix_buffer Pointer to optional array of data to write before + * buffer. + * @param prefix_len Number of bytes from prefix buffer to write + * @return Always returns true because there's no way to test success of SPI + * writes + */ +bool Adafruit_SPIDevice::write(const uint8_t *buffer, size_t len, + const uint8_t *prefix_buffer, + size_t prefix_len) { + beginTransactionWithAssertingCS(); + + // do the writing +#if defined(ARDUINO_ARCH_ESP32) + if (_spi) { + if (prefix_len > 0) { + _spi->transferBytes((uint8_t *)prefix_buffer, nullptr, prefix_len); + } + if (len > 0) { + _spi->transferBytes((uint8_t *)buffer, nullptr, len); + } + } else +#endif + { + for (size_t i = 0; i < prefix_len; i++) { + transfer(prefix_buffer[i]); + } + for (size_t i = 0; i < len; i++) { + transfer(buffer[i]); + } + } + endTransactionWithDeassertingCS(); + +#ifdef DEBUG_SERIAL + DEBUG_SERIAL.print(F("\tSPIDevice Wrote: ")); + if ((prefix_len != 0) && (prefix_buffer != nullptr)) { + for (uint16_t i = 0; i < prefix_len; i++) { + DEBUG_SERIAL.print(F("0x")); + DEBUG_SERIAL.print(prefix_buffer[i], HEX); + DEBUG_SERIAL.print(F(", ")); + } + } + for (uint16_t i = 0; i < len; i++) { + DEBUG_SERIAL.print(F("0x")); + DEBUG_SERIAL.print(buffer[i], HEX); + DEBUG_SERIAL.print(F(", ")); + if (i % 32 == 31) { + DEBUG_SERIAL.println(); + } + } + DEBUG_SERIAL.println(); +#endif + + return true; +} + +/*! + * @brief Read from SPI into a buffer from the SPI device, with transaction + * management. + * @param buffer Pointer to buffer of data to read into + * @param len Number of bytes from buffer to read. + * @param sendvalue The 8-bits of data to write when doing the data read, + * defaults to 0xFF + * @return Always returns true because there's no way to test success of SPI + * writes + */ +bool Adafruit_SPIDevice::read(uint8_t *buffer, size_t len, uint8_t sendvalue) { + memset(buffer, sendvalue, len); // clear out existing buffer + + beginTransactionWithAssertingCS(); + transfer(buffer, len); + endTransactionWithDeassertingCS(); + +#ifdef DEBUG_SERIAL + DEBUG_SERIAL.print(F("\tSPIDevice Read: ")); + for (uint16_t i = 0; i < len; i++) { + DEBUG_SERIAL.print(F("0x")); + DEBUG_SERIAL.print(buffer[i], HEX); + DEBUG_SERIAL.print(F(", ")); + if (len % 32 == 31) { + DEBUG_SERIAL.println(); + } + } + DEBUG_SERIAL.println(); +#endif + + return true; +} + +/*! + * @brief Write some data, then read some data from SPI into another buffer, + * with transaction management. The buffers can point to same/overlapping + * locations. This does not transmit-receive at the same time! + * @param write_buffer Pointer to buffer of data to write from + * @param write_len Number of bytes from buffer to write. + * @param read_buffer Pointer to buffer of data to read into. + * @param read_len Number of bytes from buffer to read. + * @param sendvalue The 8-bits of data to write when doing the data read, + * defaults to 0xFF + * @return Always returns true because there's no way to test success of SPI + * writes + */ +bool Adafruit_SPIDevice::write_then_read(const uint8_t *write_buffer, + size_t write_len, uint8_t *read_buffer, + size_t read_len, uint8_t sendvalue) { + beginTransactionWithAssertingCS(); + // do the writing +#if defined(ARDUINO_ARCH_ESP32) + if (_spi) { + if (write_len > 0) { + _spi->transferBytes((uint8_t *)write_buffer, nullptr, write_len); + } + } else +#endif + { + for (size_t i = 0; i < write_len; i++) { + transfer(write_buffer[i]); + } + } + +#ifdef DEBUG_SERIAL + DEBUG_SERIAL.print(F("\tSPIDevice Wrote: ")); + for (uint16_t i = 0; i < write_len; i++) { + DEBUG_SERIAL.print(F("0x")); + DEBUG_SERIAL.print(write_buffer[i], HEX); + DEBUG_SERIAL.print(F(", ")); + if (write_len % 32 == 31) { + DEBUG_SERIAL.println(); + } + } + DEBUG_SERIAL.println(); +#endif + + // do the reading + for (size_t i = 0; i < read_len; i++) { + read_buffer[i] = transfer(sendvalue); + } + +#ifdef DEBUG_SERIAL + DEBUG_SERIAL.print(F("\tSPIDevice Read: ")); + for (uint16_t i = 0; i < read_len; i++) { + DEBUG_SERIAL.print(F("0x")); + DEBUG_SERIAL.print(read_buffer[i], HEX); + DEBUG_SERIAL.print(F(", ")); + if (read_len % 32 == 31) { + DEBUG_SERIAL.println(); + } + } + DEBUG_SERIAL.println(); +#endif + + endTransactionWithDeassertingCS(); + + return true; +} + +/*! + * @brief Write some data and read some data at the same time from SPI + * into the same buffer, with transaction management. This is basicaly a wrapper + * for transfer() with CS-pin and transaction management. This /does/ + * transmit-receive at the same time! + * @param buffer Pointer to buffer of data to write/read to/from + * @param len Number of bytes from buffer to write/read. + * @return Always returns true because there's no way to test success of SPI + * writes + */ +bool Adafruit_SPIDevice::write_and_read(uint8_t *buffer, size_t len) { + beginTransactionWithAssertingCS(); + transfer(buffer, len); + endTransactionWithDeassertingCS(); + + return true; +} diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_SPIDevice.h b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_SPIDevice.h new file mode 100644 index 0000000..74123b9 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_SPIDevice.h @@ -0,0 +1,142 @@ +#ifndef Adafruit_SPIDevice_h +#define Adafruit_SPIDevice_h + +#include + +#if !defined(SPI_INTERFACES_COUNT) || \ + (defined(SPI_INTERFACES_COUNT) && (SPI_INTERFACES_COUNT > 0)) +// HW SPI available +#include +#define BUSIO_HAS_HW_SPI +#else +// SW SPI ONLY +enum { SPI_MODE0, SPI_MODE1, SPI_MODE2, _SPI_MODE4 }; +typedef uint8_t SPIClass; +#endif + +// some modern SPI definitions don't have BitOrder enum +#if (defined(__AVR__) && !defined(ARDUINO_ARCH_MEGAAVR)) || \ + defined(ESP8266) || defined(TEENSYDUINO) || defined(SPARK) || \ + defined(ARDUINO_ARCH_SPRESENSE) || defined(MEGATINYCORE) || \ + defined(DXCORE) || defined(ARDUINO_AVR_ATmega4809) || \ + defined(ARDUINO_AVR_ATmega4808) || defined(ARDUINO_AVR_ATmega3209) || \ + defined(ARDUINO_AVR_ATmega3208) || defined(ARDUINO_AVR_ATmega1609) || \ + defined(ARDUINO_AVR_ATmega1608) || defined(ARDUINO_AVR_ATmega809) || \ + defined(ARDUINO_AVR_ATmega808) || defined(ARDUINO_ARCH_ARC32) || \ + defined(ARDUINO_ARCH_XMC) + +typedef enum _BitOrder { + SPI_BITORDER_MSBFIRST = MSBFIRST, + SPI_BITORDER_LSBFIRST = LSBFIRST, +} BusIOBitOrder; + +#elif defined(ESP32) || defined(__ASR6501__) || defined(__ASR6502__) + +// some modern SPI definitions don't have BitOrder enum and have different SPI +// mode defines +typedef enum _BitOrder { + SPI_BITORDER_MSBFIRST = SPI_MSBFIRST, + SPI_BITORDER_LSBFIRST = SPI_LSBFIRST, +} BusIOBitOrder; + +#else +// Some platforms have a BitOrder enum but its named MSBFIRST/LSBFIRST +#define SPI_BITORDER_MSBFIRST MSBFIRST +#define SPI_BITORDER_LSBFIRST LSBFIRST +typedef BitOrder BusIOBitOrder; +#endif + +#if defined(__IMXRT1062__) // Teensy 4.x +// *Warning* I disabled the usage of FAST_PINIO as the set/clear operations +// used in the cpp file are not atomic and can effect multiple IO pins +// and if an interrupt happens in between the time the code reads the register +// and writes out the updated value, that changes one or more other IO pins +// on that same IO port, those change will be clobbered when the updated +// values are written back. A fast version can be implemented that uses the +// ports set and clear registers which are atomic. +// typedef volatile uint32_t BusIO_PortReg; +// typedef uint32_t BusIO_PortMask; +//#define BUSIO_USE_FAST_PINIO + +#elif defined(ARDUINO_ARCH_XMC) +#undef BUSIO_USE_FAST_PINIO + +#elif defined(__AVR__) || defined(TEENSYDUINO) +typedef volatile uint8_t BusIO_PortReg; +typedef uint8_t BusIO_PortMask; +#define BUSIO_USE_FAST_PINIO + +#elif defined(ESP8266) || defined(ESP32) || defined(__SAM3X8E__) || \ + defined(ARDUINO_ARCH_SAMD) +typedef volatile uint32_t BusIO_PortReg; +typedef uint32_t BusIO_PortMask; +#define BUSIO_USE_FAST_PINIO + +#elif (defined(__arm__) || defined(ARDUINO_FEATHER52)) && \ + !defined(ARDUINO_ARCH_MBED) && !defined(ARDUINO_ARCH_RP2040) +typedef volatile uint32_t BusIO_PortReg; +typedef uint32_t BusIO_PortMask; +#if !defined(__ASR6501__) && !defined(__ASR6502__) +#define BUSIO_USE_FAST_PINIO +#endif + +#else +#undef BUSIO_USE_FAST_PINIO +#endif + +/**! The class which defines how we will talk to this device over SPI **/ +class Adafruit_SPIDevice { +public: +#ifdef BUSIO_HAS_HW_SPI + Adafruit_SPIDevice(int8_t cspin, uint32_t freq = 1000000, + BusIOBitOrder dataOrder = SPI_BITORDER_MSBFIRST, + uint8_t dataMode = SPI_MODE0, SPIClass *theSPI = &SPI); +#else + Adafruit_SPIDevice(int8_t cspin, uint32_t freq = 1000000, + BusIOBitOrder dataOrder = SPI_BITORDER_MSBFIRST, + uint8_t dataMode = SPI_MODE0, SPIClass *theSPI = nullptr); +#endif + Adafruit_SPIDevice(int8_t cspin, int8_t sck, int8_t miso, int8_t mosi, + uint32_t freq = 1000000, + BusIOBitOrder dataOrder = SPI_BITORDER_MSBFIRST, + uint8_t dataMode = SPI_MODE0); + ~Adafruit_SPIDevice(); + + bool begin(void); + bool read(uint8_t *buffer, size_t len, uint8_t sendvalue = 0xFF); + bool write(const uint8_t *buffer, size_t len, + const uint8_t *prefix_buffer = nullptr, size_t prefix_len = 0); + bool write_then_read(const uint8_t *write_buffer, size_t write_len, + uint8_t *read_buffer, size_t read_len, + uint8_t sendvalue = 0xFF); + bool write_and_read(uint8_t *buffer, size_t len); + + uint8_t transfer(uint8_t send); + void transfer(uint8_t *buffer, size_t len); + void beginTransaction(void); + void endTransaction(void); + void beginTransactionWithAssertingCS(); + void endTransactionWithDeassertingCS(); + +private: +#ifdef BUSIO_HAS_HW_SPI + SPIClass *_spi = nullptr; + SPISettings *_spiSetting = nullptr; +#else + uint8_t *_spi = nullptr; + uint8_t *_spiSetting = nullptr; +#endif + uint32_t _freq; + BusIOBitOrder _dataOrder; + uint8_t _dataMode; + void setChipSelect(int value); + + int8_t _cs, _sck, _mosi, _miso; +#ifdef BUSIO_USE_FAST_PINIO + BusIO_PortReg *mosiPort, *clkPort, *misoPort, *csPort; + BusIO_PortMask mosiPinMask, misoPinMask, clkPinMask, csPinMask; +#endif + bool _begun; +}; + +#endif // Adafruit_SPIDevice_h diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/CMakeLists.txt b/.pio/libdeps/teensy41/Adafruit BusIO/CMakeLists.txt new file mode 100644 index 0000000..880b1aa --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/CMakeLists.txt @@ -0,0 +1,11 @@ +# Adafruit Bus IO Library +# https://github.com/adafruit/Adafruit_BusIO +# MIT License + +cmake_minimum_required(VERSION 3.5) + +idf_component_register(SRCS "Adafruit_I2CDevice.cpp" "Adafruit_BusIO_Register.cpp" "Adafruit_SPIDevice.cpp" + INCLUDE_DIRS "." + REQUIRES arduino) + +project(Adafruit_BusIO) diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/LICENSE b/.pio/libdeps/teensy41/Adafruit BusIO/LICENSE new file mode 100644 index 0000000..860e3e2 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 Adafruit Industries + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/README.md b/.pio/libdeps/teensy41/Adafruit BusIO/README.md new file mode 100644 index 0000000..1cc06a1 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/README.md @@ -0,0 +1,8 @@ +# Adafruit Bus IO Library [![Build Status](https://github.com/adafruit/Adafruit_BusIO/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_BusIO/actions) + + +This is a helper library to abstract away I2C & SPI transactions and registers + +Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! + +MIT license, all text above must be included in any redistribution diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/component.mk b/.pio/libdeps/teensy41/Adafruit BusIO/component.mk new file mode 100644 index 0000000..049f190 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/component.mk @@ -0,0 +1 @@ +COMPONENT_ADD_INCLUDEDIRS = . diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_address_detect/i2c_address_detect.ino b/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_address_detect/i2c_address_detect.ino new file mode 100644 index 0000000..b150525 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_address_detect/i2c_address_detect.ino @@ -0,0 +1,21 @@ +#include + +Adafruit_I2CDevice i2c_dev = Adafruit_I2CDevice(0x10); + +void setup() { + while (!Serial) { delay(10); } + Serial.begin(115200); + Serial.println("I2C address detection test"); + + if (!i2c_dev.begin()) { + Serial.print("Did not find device at 0x"); + Serial.println(i2c_dev.address(), HEX); + while (1); + } + Serial.print("Device found on address 0x"); + Serial.println(i2c_dev.address(), HEX); +} + +void loop() { + +} diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_readwrite/i2c_readwrite.ino b/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_readwrite/i2c_readwrite.ino new file mode 100644 index 0000000..909cf31 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_readwrite/i2c_readwrite.ino @@ -0,0 +1,41 @@ +#include + +#define I2C_ADDRESS 0x60 +Adafruit_I2CDevice i2c_dev = Adafruit_I2CDevice(I2C_ADDRESS); + + +void setup() { + while (!Serial) { delay(10); } + Serial.begin(115200); + Serial.println("I2C device read and write test"); + + if (!i2c_dev.begin()) { + Serial.print("Did not find device at 0x"); + Serial.println(i2c_dev.address(), HEX); + while (1); + } + Serial.print("Device found on address 0x"); + Serial.println(i2c_dev.address(), HEX); + + uint8_t buffer[32]; + // Try to read 32 bytes + i2c_dev.read(buffer, 32); + Serial.print("Read: "); + for (uint8_t i=0; i<32; i++) { + Serial.print("0x"); Serial.print(buffer[i], HEX); Serial.print(", "); + } + Serial.println(); + + // read a register by writing first, then reading + buffer[0] = 0x0C; // we'll reuse the same buffer + i2c_dev.write_then_read(buffer, 1, buffer, 2, false); + Serial.print("Write then Read: "); + for (uint8_t i=0; i<2; i++) { + Serial.print("0x"); Serial.print(buffer[i], HEX); Serial.print(", "); + } + Serial.println(); +} + +void loop() { + +} diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_registers/i2c_registers.ino b/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_registers/i2c_registers.ino new file mode 100644 index 0000000..41a3043 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_registers/i2c_registers.ino @@ -0,0 +1,38 @@ +#include +#include + +#define I2C_ADDRESS 0x60 +Adafruit_I2CDevice i2c_dev = Adafruit_I2CDevice(I2C_ADDRESS); + + +void setup() { + while (!Serial) { delay(10); } + Serial.begin(115200); + Serial.println("I2C device register test"); + + if (!i2c_dev.begin()) { + Serial.print("Did not find device at 0x"); + Serial.println(i2c_dev.address(), HEX); + while (1); + } + Serial.print("Device found on address 0x"); + Serial.println(i2c_dev.address(), HEX); + + Adafruit_BusIO_Register id_reg = Adafruit_BusIO_Register(&i2c_dev, 0x0C, 2, LSBFIRST); + uint16_t id; + id_reg.read(&id); + Serial.print("ID register = 0x"); Serial.println(id, HEX); + + Adafruit_BusIO_Register thresh_reg = Adafruit_BusIO_Register(&i2c_dev, 0x01, 2, LSBFIRST); + uint16_t thresh; + thresh_reg.read(&thresh); + Serial.print("Initial threshold register = 0x"); Serial.println(thresh, HEX); + + thresh_reg.write(~thresh); + + Serial.print("Post threshold register = 0x"); Serial.println(thresh_reg.read(), HEX); +} + +void loop() { + +} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2corspi_register/i2corspi_register.ino b/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2corspi_register/i2corspi_register.ino new file mode 100644 index 0000000..992a2e0 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2corspi_register/i2corspi_register.ino @@ -0,0 +1,38 @@ +#include + +// Define which interface to use by setting the unused interface to NULL! + +#define SPIDEVICE_CS 10 +Adafruit_SPIDevice *spi_dev = NULL; // new Adafruit_SPIDevice(SPIDEVICE_CS); + +#define I2C_ADDRESS 0x5D +Adafruit_I2CDevice *i2c_dev = new Adafruit_I2CDevice(I2C_ADDRESS); + +void setup() { + while (!Serial) { delay(10); } + Serial.begin(115200); + Serial.println("I2C or SPI device register test"); + + if (spi_dev && !spi_dev->begin()) { + Serial.println("Could not initialize SPI device"); + } + + if (i2c_dev) { + if (i2c_dev->begin()) { + Serial.print("Device found on I2C address 0x"); + Serial.println(i2c_dev->address(), HEX); + } else { + Serial.print("Did not find I2C device at 0x"); + Serial.println(i2c_dev->address(), HEX); + } + } + + Adafruit_BusIO_Register id_reg = Adafruit_BusIO_Register(i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, 0x0F); + uint8_t id=0; + id_reg.read(&id); + Serial.print("ID register = 0x"); Serial.println(id, HEX); +} + +void loop() { + +} diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_modetest/spi_modetest.ino b/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_modetest/spi_modetest.ino new file mode 100644 index 0000000..10168c5 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_modetest/spi_modetest.ino @@ -0,0 +1,29 @@ +#include + +#define SPIDEVICE_CS 10 +Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice(SPIDEVICE_CS, 100000, SPI_BITORDER_MSBFIRST, SPI_MODE1); +//Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice(SPIDEVICE_CS, 13, 12, 11, 100000, SPI_BITORDER_MSBFIRST, SPI_MODE1); + + +void setup() { + while (!Serial) { delay(10); } + Serial.begin(115200); + Serial.println("SPI device mode test"); + + if (!spi_dev.begin()) { + Serial.println("Could not initialize SPI device"); + while (1); + } +} + +void loop() { + Serial.println("\n\nTransfer test"); + for (uint16_t x=0; x<=0xFF; x++) { + uint8_t i = x; + Serial.print("0x"); Serial.print(i, HEX); + spi_dev.read(&i, 1, i); + Serial.print("/"); Serial.print(i, HEX); + Serial.print(", "); + delay(25); + } +} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_readwrite/spi_readwrite.ino b/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_readwrite/spi_readwrite.ino new file mode 100644 index 0000000..6f2c063 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_readwrite/spi_readwrite.ino @@ -0,0 +1,39 @@ +#include + +#define SPIDEVICE_CS 10 +Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice(SPIDEVICE_CS); + + +void setup() { + while (!Serial) { delay(10); } + Serial.begin(115200); + Serial.println("SPI device read and write test"); + + if (!spi_dev.begin()) { + Serial.println("Could not initialize SPI device"); + while (1); + } + + uint8_t buffer[32]; + + // Try to read 32 bytes + spi_dev.read(buffer, 32); + Serial.print("Read: "); + for (uint8_t i=0; i<32; i++) { + Serial.print("0x"); Serial.print(buffer[i], HEX); Serial.print(", "); + } + Serial.println(); + + // read a register by writing first, then reading + buffer[0] = 0x8F; // we'll reuse the same buffer + spi_dev.write_then_read(buffer, 1, buffer, 2, false); + Serial.print("Write then Read: "); + for (uint8_t i=0; i<2; i++) { + Serial.print("0x"); Serial.print(buffer[i], HEX); Serial.print(", "); + } + Serial.println(); +} + +void loop() { + +} diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_register_bits/spi_register_bits.ino b/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_register_bits/spi_register_bits.ino new file mode 100644 index 0000000..e70a17b --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_register_bits/spi_register_bits.ino @@ -0,0 +1,192 @@ +/*************************************************** + + This is an example for how to use Adafruit_BusIO_RegisterBits from Adafruit_BusIO library. + + Designed specifically to work with the Adafruit RTD Sensor + ----> https://www.adafruit.com/products/3328 + uisng a MAX31865 RTD-to-Digital Converter + ----> https://datasheets.maximintegrated.com/en/ds/MAX31865.pdf + + This sensor uses SPI to communicate, 4 pins are required to + interface. + A fifth pin helps to detect when a new conversion is ready. + + Adafruit invests time and resources providing this open source code, + please support Adafruit and open-source hardware by purchasing + products from Adafruit! + + Example written (2020/3) by Andreas Hardtung/AnHard. + BSD license, all text above must be included in any redistribution + ****************************************************/ + +#include +#include + +#define MAX31865_SPI_SPEED (5000000) +#define MAX31865_SPI_BITORDER (SPI_BITORDER_MSBFIRST) +#define MAX31865_SPI_MODE (SPI_MODE1) + +#define MAX31865_SPI_CS (10) +#define MAX31865_READY_PIN (2) + + +Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice( MAX31865_SPI_CS, MAX31865_SPI_SPEED, MAX31865_SPI_BITORDER, MAX31865_SPI_MODE, &SPI); // Hardware SPI +// Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice( MAX31865_SPI_CS, 13, 12, 11, MAX31865_SPI_SPEED, MAX31865_SPI_BITORDER, MAX31865_SPI_MODE); // Software SPI + +// MAX31865 chip related ********************************************************************************************* +Adafruit_BusIO_Register config_reg = Adafruit_BusIO_Register(&spi_dev, 0x00, ADDRBIT8_HIGH_TOWRITE, 1, MSBFIRST); +Adafruit_BusIO_RegisterBits bias_bit = Adafruit_BusIO_RegisterBits(&config_reg, 1, 7); +Adafruit_BusIO_RegisterBits auto_bit = Adafruit_BusIO_RegisterBits(&config_reg, 1, 6); +Adafruit_BusIO_RegisterBits oneS_bit = Adafruit_BusIO_RegisterBits(&config_reg, 1, 5); +Adafruit_BusIO_RegisterBits wire_bit = Adafruit_BusIO_RegisterBits(&config_reg, 1, 4); +Adafruit_BusIO_RegisterBits faultT_bits = Adafruit_BusIO_RegisterBits(&config_reg, 2, 2); +Adafruit_BusIO_RegisterBits faultR_bit = Adafruit_BusIO_RegisterBits(&config_reg, 1, 1); +Adafruit_BusIO_RegisterBits fi50hz_bit = Adafruit_BusIO_RegisterBits(&config_reg, 1, 0); + +Adafruit_BusIO_Register rRatio_reg = Adafruit_BusIO_Register(&spi_dev, 0x01, ADDRBIT8_HIGH_TOWRITE, 2, MSBFIRST); +Adafruit_BusIO_RegisterBits rRatio_bits = Adafruit_BusIO_RegisterBits(&rRatio_reg, 15, 1); +Adafruit_BusIO_RegisterBits fault_bit = Adafruit_BusIO_RegisterBits(&rRatio_reg, 1, 0); + +Adafruit_BusIO_Register maxRratio_reg = Adafruit_BusIO_Register(&spi_dev, 0x03, ADDRBIT8_HIGH_TOWRITE, 2, MSBFIRST); +Adafruit_BusIO_RegisterBits maxRratio_bits = Adafruit_BusIO_RegisterBits(&maxRratio_reg, 15, 1); + +Adafruit_BusIO_Register minRratio_reg = Adafruit_BusIO_Register(&spi_dev, 0x05, ADDRBIT8_HIGH_TOWRITE, 2, MSBFIRST); +Adafruit_BusIO_RegisterBits minRratio_bits = Adafruit_BusIO_RegisterBits(&minRratio_reg, 15, 1); + +Adafruit_BusIO_Register fault_reg = Adafruit_BusIO_Register(&spi_dev, 0x07, ADDRBIT8_HIGH_TOWRITE, 1, MSBFIRST); +Adafruit_BusIO_RegisterBits range_high_fault_bit = Adafruit_BusIO_RegisterBits(&fault_reg, 1, 7); +Adafruit_BusIO_RegisterBits range_low_fault_bit = Adafruit_BusIO_RegisterBits(&fault_reg, 1, 6); +Adafruit_BusIO_RegisterBits refin_high_fault_bit = Adafruit_BusIO_RegisterBits(&fault_reg, 1, 5); +Adafruit_BusIO_RegisterBits refin_low_fault_bit = Adafruit_BusIO_RegisterBits(&fault_reg, 1, 4); +Adafruit_BusIO_RegisterBits rtdin_low_fault_bit = Adafruit_BusIO_RegisterBits(&fault_reg, 1, 3); +Adafruit_BusIO_RegisterBits voltage_fault_bit = Adafruit_BusIO_RegisterBits(&fault_reg, 1, 2); + +// Print the details of the configuration register. +void printConfig( void ) { + Serial.print("BIAS: "); if (bias_bit.read() ) Serial.print("ON"); else Serial.print("OFF"); + Serial.print(", AUTO: "); if (auto_bit.read() ) Serial.print("ON"); else Serial.print("OFF"); + Serial.print(", ONES: "); if (oneS_bit.read() ) Serial.print("ON"); else Serial.print("OFF"); + Serial.print(", WIRE: "); if (wire_bit.read() ) Serial.print("3"); else Serial.print("2/4"); + Serial.print(", FAULTCLEAR: "); if (faultR_bit.read() ) Serial.print("ON"); else Serial.print("OFF"); + Serial.print(", "); if (fi50hz_bit.read() ) Serial.print("50HZ"); else Serial.print("60HZ"); + Serial.println(); +} + +// Check and print faults. Then clear them. +void checkFaults( void ) { + if (fault_bit.read()) { + Serial.print("MAX: "); Serial.println(maxRratio_bits.read()); + Serial.print("VAL: "); Serial.println( rRatio_bits.read()); + Serial.print("MIN: "); Serial.println(minRratio_bits.read()); + + if (range_high_fault_bit.read() ) Serial.println("Range high fault"); + if ( range_low_fault_bit.read() ) Serial.println("Range low fault"); + if (refin_high_fault_bit.read() ) Serial.println("REFIN high fault"); + if ( refin_low_fault_bit.read() ) Serial.println("REFIN low fault"); + if ( rtdin_low_fault_bit.read() ) Serial.println("RTDIN low fault"); + if ( voltage_fault_bit.read() ) Serial.println("Voltage fault"); + + faultR_bit.write(1); // clear fault + } +} + +void setup() { + #if (MAX31865_1_READY_PIN != -1) + pinMode(MAX31865_READY_PIN ,INPUT_PULLUP); + #endif + + while (!Serial) { delay(10); } + Serial.begin(115200); + Serial.println("SPI Adafruit_BusIO_RegisterBits test on MAX31865"); + + if (!spi_dev.begin()) { + Serial.println("Could not initialize SPI device"); + while (1); + } + + // Set up for automode 50Hz. We don't care about selfheating. We want the highest possible sampling rate. + auto_bit.write(0); // Don't switch filtermode while auto_mode is on. + fi50hz_bit.write(1); // Set filter to 50Hz mode. + faultR_bit.write(1); // Clear faults. + bias_bit.write(1); // In automode we want to have the bias current always on. + delay(5); // Wait until bias current settles down. + // 10.5 time constants of the input RC network is required. + // 10ms worst case for 10kω reference resistor and a 0.1µF capacitor across the RTD inputs. + // Adafruit Module has 0.1µF and only 430/4300ω So here 0.43/4.3ms + auto_bit.write(1); // Now we can set automode. Automatically starting first conversion. + + // Test the READY_PIN + #if (defined( MAX31865_READY_PIN ) && (MAX31865_READY_PIN != -1)) + int i = 0; + while (digitalRead(MAX31865_READY_PIN) && i++ <= 100) { delay(1); } + if (i >= 100) { + Serial.print("ERROR: Max31865 Pin detection does not work. PIN:"); + Serial.println(MAX31865_READY_PIN); + } + #else + delay(100); + #endif + + // Set ratio range. + // Setting the temperatures would need some more calculation - not related to Adafruit_BusIO_RegisterBits. + uint16_t ratio = rRatio_bits.read(); + maxRratio_bits.write( (ratio < 0x8fffu-1000u) ? ratio + 1000u : 0x8fffu ); + minRratio_bits.write( (ratio > 1000u) ? ratio - 1000u : 0u ); + + printConfig(); + checkFaults(); +} + +void loop() { + #if (defined( MAX31865_READY_PIN ) && (MAX31865_1_READY_PIN != -1)) + // Is conversion ready? + if (!digitalRead(MAX31865_READY_PIN)) + #else + // Warant conversion is ready. + delay(21); // 21ms for 50Hz-mode. 19ms in 60Hz-mode. + #endif + { + // Read ratio, calculate temperature, scale, filter and print. + Serial.println( rRatio2C( rRatio_bits.read() ) * 100.0f, 0); // Temperature scaled by 100 + // Check, print, clear faults. + checkFaults(); + } + + // Do something else. + //delay(15000); +} + + +// Module/Sensor related. Here Adafruit PT100 module with a 2_Wire PT100 Class C ***************************** +float rRatio2C(uint16_t ratio) { + // A simple linear conversion. + const float R0 = 100.0f; + const float Rref = 430.0f; + const float alphaPT = 0.003850f; + const float ADCmax = (1u << 15) - 1.0f; + const float rscale = Rref / ADCmax; + // Measured temperature in boiling water 101.08°C with factor a = 1 and b = 0. Rref and MAX at about 22±2°C. + // Measured temperature in ice/water bath 0.76°C with factor a = 1 and b = 0. Rref and MAX at about 22±2°C. + //const float a = 1.0f / (alphaPT * R0); + const float a = (100.0f/101.08f) / (alphaPT * R0); + //const float b = 0.0f; // 101.08 + const float b = -0.76f; // 100.32 > 101.08 + + return filterRing( ((ratio * rscale) - R0) * a + b ); +} + +// General purpose ********************************************************************************************* +#define RINGLENGTH 250 +float filterRing( float newVal ) { + static float ring[RINGLENGTH] = { 0.0 }; + static uint8_t ringIndex = 0; + static bool ringFull = false; + + if ( ringIndex == RINGLENGTH ) { ringFull = true; ringIndex = 0; } + ring[ringIndex] = newVal; + uint8_t loopEnd = (ringFull) ? RINGLENGTH : ringIndex + 1; + float ringSum = 0.0f; + for (uint8_t i = 0; i < loopEnd; i++) ringSum += ring[i]; + ringIndex++; + return ringSum / loopEnd; +} diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_registers/spi_registers.ino b/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_registers/spi_registers.ino new file mode 100644 index 0000000..091a353 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_registers/spi_registers.ino @@ -0,0 +1,34 @@ +#include +#include + +#define SPIDEVICE_CS 10 +Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice(SPIDEVICE_CS); + +void setup() { + while (!Serial) { delay(10); } + Serial.begin(115200); + Serial.println("SPI device register test"); + + if (!spi_dev.begin()) { + Serial.println("Could not initialize SPI device"); + while (1); + } + + Adafruit_BusIO_Register id_reg = Adafruit_BusIO_Register(&spi_dev, 0x0F, ADDRBIT8_HIGH_TOREAD); + uint8_t id = 0; + id_reg.read(&id); + Serial.print("ID register = 0x"); Serial.println(id, HEX); + + Adafruit_BusIO_Register thresh_reg = Adafruit_BusIO_Register(&spi_dev, 0x0C, ADDRBIT8_HIGH_TOREAD, 2, LSBFIRST); + uint16_t thresh = 0; + thresh_reg.read(&thresh); + Serial.print("Initial threshold register = 0x"); Serial.println(thresh, HEX); + + thresh_reg.write(~thresh); + + Serial.print("Post threshold register = 0x"); Serial.println(thresh_reg.read(), HEX); +} + +void loop() { + +} diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/library.properties b/.pio/libdeps/teensy41/Adafruit BusIO/library.properties new file mode 100644 index 0000000..ba652bb --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit BusIO/library.properties @@ -0,0 +1,9 @@ +name=Adafruit BusIO +version=1.14.5 +author=Adafruit +maintainer=Adafruit +sentence=This is a library for abstracting away I2C and SPI interfacing +paragraph=This is a library for abstracting away I2C and SPI interfacing +category=Signal Input/Output +url=https://github.com/adafruit/Adafruit_BusIO +architectures=* diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/.github/ISSUE_TEMPLATE.md b/.pio/libdeps/teensy41/Adafruit LSM6DS/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..f0e2614 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,46 @@ +Thank you for opening an issue on an Adafruit Arduino library repository. To +improve the speed of resolution please review the following guidelines and +common troubleshooting steps below before creating the issue: + +- **Do not use GitHub issues for troubleshooting projects and issues.** Instead use + the forums at http://forums.adafruit.com to ask questions and troubleshoot why + something isn't working as expected. In many cases the problem is a common issue + that you will more quickly receive help from the forum community. GitHub issues + are meant for known defects in the code. If you don't know if there is a defect + in the code then start with troubleshooting on the forum first. + +- **If following a tutorial or guide be sure you didn't miss a step.** Carefully + check all of the steps and commands to run have been followed. Consult the + forum if you're unsure or have questions about steps in a guide/tutorial. + +- **For Arduino projects check these very common issues to ensure they don't apply**: + + - For uploading sketches or communicating with the board make sure you're using + a **USB data cable** and **not** a **USB charge-only cable**. It is sometimes + very hard to tell the difference between a data and charge cable! Try using the + cable with other devices or swapping to another cable to confirm it is not + the problem. + + - **Be sure you are supplying adequate power to the board.** Check the specs of + your board and plug in an external power supply. In many cases just + plugging a board into your computer is not enough to power it and other + peripherals. + + - **Double check all soldering joints and connections.** Flakey connections + cause many mysterious problems. See the [guide to excellent soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering/tools) for examples of good solder joints. + + - **Ensure you are using an official Arduino or Adafruit board.** We can't + guarantee a clone board will have the same functionality and work as expected + with this code and don't support them. + +If you're sure this issue is a defect in the code and checked the steps above +please fill in the following fields to provide enough troubleshooting information. +You may delete the guideline and text above to just leave the following details: + +- Arduino board: **INSERT ARDUINO BOARD NAME/TYPE HERE** + +- Arduino IDE version (found in Arduino -> About Arduino menu): **INSERT ARDUINO + VERSION HERE** + +- List the steps to reproduce the problem below (if possible attach a sketch or + copy the sketch code in too): **LIST REPRO STEPS BELOW** diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/.github/PULL_REQUEST_TEMPLATE.md b/.pio/libdeps/teensy41/Adafruit LSM6DS/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..7b641eb --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,26 @@ +Thank you for creating a pull request to contribute to Adafruit's GitHub code! +Before you open the request please review the following guidelines and tips to +help it be more easily integrated: + +- **Describe the scope of your change--i.e. what the change does and what parts + of the code were modified.** This will help us understand any risks of integrating + the code. + +- **Describe any known limitations with your change.** For example if the change + doesn't apply to a supported platform of the library please mention it. + +- **Please run any tests or examples that can exercise your modified code.** We + strive to not break users of the code and running tests/examples helps with this + process. + +Thank you again for contributing! We will try to test and integrate the change +as soon as we can, but be aware we have many GitHub repositories to manage and +can't immediately respond to every request. There is no need to bump or check in +on a pull request (it will clutter the discussion of the request). + +Also don't be worried if the request is closed or not integrated--sometimes the +priorities of Adafruit's GitHub code (education, ease of use) might not match the +priorities of the pull request. Don't fret, the open source community thrives on +forks and GitHub makes it easy to keep your changes in a forked repo. + +After reviewing the guidelines above you can delete this text from the pull request. diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/.github/workflows/githubci.yml b/.pio/libdeps/teensy41/Adafruit LSM6DS/.github/workflows/githubci.yml new file mode 100644 index 0000000..c62a1db --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/.github/workflows/githubci.yml @@ -0,0 +1,32 @@ +name: Arduino Library CI + +on: [pull_request, push, repository_dispatch] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/setup-python@v1 + with: + python-version: '3.x' + - uses: actions/checkout@v2 + - uses: actions/checkout@v2 + with: + repository: adafruit/ci-arduino + path: ci + + - name: Install the prerequisites + run: bash ci/actions_install.sh + + - name: Check for correct code formatting with clang-format + run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r . + + - name: Check for correct documentation with doxygen + env: + GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }} + PRETTYNAME : "Adafruit LSM6DS Sensors Library" + run: bash ci/doxy_gen_and_deploy.sh + + - name: Test the code on supported platforms + run: python3 ci/build_platform.py main_platforms diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/.gitignore b/.pio/libdeps/teensy41/Adafruit LSM6DS/.gitignore new file mode 100644 index 0000000..e7e2338 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/.gitignore @@ -0,0 +1,5 @@ +*.elf +*.hex +html/ +Doxyfile +.vscode/ diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/.piopm b/.pio/libdeps/teensy41/Adafruit LSM6DS/.piopm new file mode 100644 index 0000000..99e5f30 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/.piopm @@ -0,0 +1 @@ +{"type": "library", "name": "Adafruit LSM6DS", "version": "4.7.0", "spec": {"owner": "adafruit", "id": 6897, "name": "Adafruit LSM6DS", "requirements": null, "uri": null}} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_ISM330DHCX.cpp b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_ISM330DHCX.cpp new file mode 100644 index 0000000..7aec3a2 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_ISM330DHCX.cpp @@ -0,0 +1,35 @@ + +/*! + * @file Adafruit_ISM330DHCX.cpp Adafruit ISM330DHCX 6-DoF Accelerometer + * and Gyroscope library + * + * Bryan Siepert for Adafruit Industries + * BSD (see license.txt) + */ + +#include "Arduino.h" +#include + +#include "Adafruit_ISM330DHCX.h" + +/*! + * @brief Instantiates a new ISM330DHCX class + */ +Adafruit_ISM330DHCX::Adafruit_ISM330DHCX(void) {} + +bool Adafruit_ISM330DHCX::_init(int32_t sensor_id) { + // make sure we're talking to the right chip + if (chipID() != ISM330DHCX_CHIP_ID) { + return false; + } + _sensorid_accel = sensor_id; + _sensorid_gyro = sensor_id + 1; + _sensorid_temp = sensor_id + 2; + + reset(); + + // call base class _init() + Adafruit_LSM6DS::_init(sensor_id); + + return true; +} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_ISM330DHCX.h b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_ISM330DHCX.h new file mode 100644 index 0000000..5d6407a --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_ISM330DHCX.h @@ -0,0 +1,38 @@ +/*! + * @file Adafruit_ISM330DHCX.h + * + * I2C Driver for the Adafruit ISM330DHCX 6-DoF Accelerometer and Gyroscope + *library + * + * This is a library for the Adafruit ISM330DHCX breakout: + * https://www.adafruit.com/products/4480 + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing products from + * Adafruit! + * + * + * BSD license (see license.txt) + */ + +#ifndef _ADAFRUIT_ISM330DHCX_H +#define _ADAFRUIT_ISM330DHCX_H + +#include "Adafruit_LSM6DSOX.h" + +#define ISM330DHCX_CHIP_ID 0x6B ///< ISM330DHCX default device id from WHOAMI + +/*! + * @brief Class that stores state and functions for interacting with + * the ISM330DHCX I2C Digital Potentiometer + */ +class Adafruit_ISM330DHCX : public Adafruit_LSM6DSOX { +public: + Adafruit_ISM330DHCX(); + ~Adafruit_ISM330DHCX(){}; + +private: + bool _init(int32_t sensor_id); +}; + +#endif diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS.cpp b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS.cpp new file mode 100644 index 0000000..5a12521 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS.cpp @@ -0,0 +1,895 @@ + +/*! + * @file Adafruit_LSM6DS.cpp Adafruit LSM6DS 6-DoF Accelerometer + * and Gyroscope library + * + * @section intro_sec Introduction + * + * I2C Driver base for Adafruit LSM6DS 6-DoF Accelerometer + * and Gyroscope libraries + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing products from + * Adafruit! + * + * @section dependencies Dependencies + * This library depends on the Adafruit BusIO library + * + * This library depends on the Adafruit Unified Sensor library + + * @section author Author + * + * Bryan Siepert for Adafruit Industries + * + * @section license License + * + * BSD (see license.txt) + * + * @section HISTORY + * + * v1.0 - First release + */ + +#include "Arduino.h" +#include + +#include "Adafruit_LSM6DS.h" + +static const float _data_rate_arr[] = { + [LSM6DS_RATE_SHUTDOWN] = 0.0f, [LSM6DS_RATE_12_5_HZ] = 12.5f, + [LSM6DS_RATE_26_HZ] = 26.0f, [LSM6DS_RATE_52_HZ] = 52.0f, + [LSM6DS_RATE_104_HZ] = 104.0f, [LSM6DS_RATE_208_HZ] = 208.0f, + [LSM6DS_RATE_416_HZ] = 416.0f, [LSM6DS_RATE_833_HZ] = 833.0f, + [LSM6DS_RATE_1_66K_HZ] = 1660.0f, [LSM6DS_RATE_3_33K_HZ] = 3330.0f, + [LSM6DS_RATE_6_66K_HZ] = 6660.0f, +}; + +/*! + * @brief Instantiates a new LSM6DS class + */ +Adafruit_LSM6DS::Adafruit_LSM6DS(void) {} + +/*! + * @brief Cleans up the LSM6DS + */ +Adafruit_LSM6DS::~Adafruit_LSM6DS(void) { delete temp_sensor; } + +/*! @brief Unique subclass initializer post i2c/spi init + * @param sensor_id Optional unique ID for the sensor set + * @returns True if chip identified and initialized + */ +bool Adafruit_LSM6DS::_init(int32_t sensor_id) { + (void)sensor_id; + + // Enable accelerometer with 104 Hz data rate, 4G + setAccelDataRate(LSM6DS_RATE_104_HZ); + setAccelRange(LSM6DS_ACCEL_RANGE_4_G); + + // Enable gyro with 104 Hz data rate, 2000 dps + setGyroDataRate(LSM6DS_RATE_104_HZ); + setGyroRange(LSM6DS_GYRO_RANGE_2000_DPS); + + delay(10); + + // delete objects if sensor is reinitialized + delete temp_sensor; + delete accel_sensor; + delete gyro_sensor; + + temp_sensor = new Adafruit_LSM6DS_Temp(this); + accel_sensor = new Adafruit_LSM6DS_Accelerometer(this); + gyro_sensor = new Adafruit_LSM6DS_Gyro(this); + + return false; +}; + +/*! + * @brief Read chip identification register + * @returns 8 Bit value from WHOAMI register + */ +uint8_t Adafruit_LSM6DS::chipID(void) { + Adafruit_BusIO_Register chip_id = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_WHOAMI); + // Serial.print("Read ID 0x"); Serial.println(chip_id.read(), HEX); + + // make sure we're talking to the right chip + return chip_id.read(); +} + +/*! + * @brief Read Status register + * @returns 8 Bit value from Status register + */ +uint8_t Adafruit_LSM6DS::status(void) { + Adafruit_BusIO_Register status_reg = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_STATUS_REG); + return status_reg.read(); +} + +/*! + * @brief Sets up the hardware and initializes I2C + * @param i2c_address + * The I2C address to be used. + * @param wire + * The Wire object to be used for I2C connections. + * @param sensor_id + * The user-defined ID to differentiate different sensors + * @return True if initialization was successful, otherwise false. + */ +boolean Adafruit_LSM6DS::begin_I2C(uint8_t i2c_address, TwoWire *wire, + int32_t sensor_id) { + delete i2c_dev; // remove old interface + + i2c_dev = new Adafruit_I2CDevice(i2c_address, wire); + + if (!i2c_dev->begin()) { + return false; + } + + return _init(sensor_id); +} + +/*! + * @brief Sets up the hardware and initializes hardware SPI + * @param cs_pin The arduino pin # connected to chip select + * @param theSPI The SPI object to be used for SPI connections. + * @param frequency The SPI bus frequency + * @param sensor_id + * The user-defined ID to differentiate different sensors + * @return True if initialization was successful, otherwise false. + */ +bool Adafruit_LSM6DS::begin_SPI(uint8_t cs_pin, SPIClass *theSPI, + int32_t sensor_id, uint32_t frequency) { + i2c_dev = NULL; + + delete spi_dev; // remove old interface + + spi_dev = new Adafruit_SPIDevice(cs_pin, + frequency, // frequency + SPI_BITORDER_MSBFIRST, // bit order + SPI_MODE0, // data mode + theSPI); + if (!spi_dev->begin()) { + return false; + } + + return _init(sensor_id); +} + +/*! + * @brief Sets up the hardware and initializes software SPI + * @param cs_pin The arduino pin # connected to chip select + * @param sck_pin The arduino pin # connected to SPI clock + * @param miso_pin The arduino pin # connected to SPI MISO + * @param mosi_pin The arduino pin # connected to SPI MOSI + * @param frequency The SPI bus frequency + * @param sensor_id + * The user-defined ID to differentiate different sensors + * @return True if initialization was successful, otherwise false. + */ +bool Adafruit_LSM6DS::begin_SPI(int8_t cs_pin, int8_t sck_pin, int8_t miso_pin, + int8_t mosi_pin, int32_t sensor_id, + uint32_t frequency) { + i2c_dev = NULL; + + delete spi_dev; // remove old interface + + spi_dev = new Adafruit_SPIDevice(cs_pin, sck_pin, miso_pin, mosi_pin, + frequency, // frequency + SPI_BITORDER_MSBFIRST, // bit order + SPI_MODE0); // data mode + if (!spi_dev->begin()) { + return false; + } + + return _init(sensor_id); +} + +/**************************************************************************/ +/*! + @brief Resets the sensor to its power-on state, clearing all registers and + memory +*/ +void Adafruit_LSM6DS::reset(void) { + + Adafruit_BusIO_Register ctrl3 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL3_C); + + Adafruit_BusIO_RegisterBits sw_reset = + Adafruit_BusIO_RegisterBits(&ctrl3, 1, 0); + + // Adafruit_BusIO_RegisterBits boot = Adafruit_BusIO_RegisterBits(&ctrl3, 1, + // 7); + + sw_reset.write(true); + + while (sw_reset.read()) { + delay(1); + } +} + +/*! + @brief Gets an Adafruit Unified Sensor object for the temp sensor component + @return Adafruit_Sensor pointer to temperature sensor + */ +Adafruit_Sensor *Adafruit_LSM6DS::getTemperatureSensor(void) { + return temp_sensor; +} + +/*! + @brief Gets an Adafruit Unified Sensor object for the accelerometer + sensor component + @return Adafruit_Sensor pointer to accelerometer sensor + */ +Adafruit_Sensor *Adafruit_LSM6DS::getAccelerometerSensor(void) { + return accel_sensor; +} + +/*! + @brief Gets an Adafruit Unified Sensor object for the gyro sensor component + @return Adafruit_Sensor pointer to gyro sensor + */ +Adafruit_Sensor *Adafruit_LSM6DS::getGyroSensor(void) { return gyro_sensor; } + +/**************************************************************************/ +/*! + @brief Gets the most recent sensor event, Adafruit Unified Sensor format + @param accel + Pointer to an Adafruit Unified sensor_event_t object to be filled + with acceleration event data. + + @param gyro + Pointer to an Adafruit Unified sensor_event_t object to be filled + with gyro event data. + + @param temp + Pointer to an Adafruit Unified sensor_event_t object to be filled + with temperature event data. + + @return True on successful read +*/ +/**************************************************************************/ +bool Adafruit_LSM6DS::getEvent(sensors_event_t *accel, sensors_event_t *gyro, + sensors_event_t *temp) { + uint32_t t = millis(); + _read(); + + // use helpers to fill in the events + fillAccelEvent(accel, t); + fillGyroEvent(gyro, t); + fillTempEvent(temp, t); + return true; +} + +void Adafruit_LSM6DS::fillTempEvent(sensors_event_t *temp, uint32_t timestamp) { + memset(temp, 0, sizeof(sensors_event_t)); + temp->version = sizeof(sensors_event_t); + temp->sensor_id = _sensorid_temp; + temp->type = SENSOR_TYPE_AMBIENT_TEMPERATURE; + temp->timestamp = timestamp; + temp->temperature = temperature; +} + +void Adafruit_LSM6DS::fillGyroEvent(sensors_event_t *gyro, uint32_t timestamp) { + memset(gyro, 0, sizeof(sensors_event_t)); + gyro->version = 1; + gyro->sensor_id = _sensorid_gyro; + gyro->type = SENSOR_TYPE_GYROSCOPE; + gyro->timestamp = timestamp; + gyro->gyro.x = gyroX; + gyro->gyro.y = gyroY; + gyro->gyro.z = gyroZ; +} + +void Adafruit_LSM6DS::fillAccelEvent(sensors_event_t *accel, + uint32_t timestamp) { + memset(accel, 0, sizeof(sensors_event_t)); + accel->version = 1; + accel->sensor_id = _sensorid_accel; + accel->type = SENSOR_TYPE_ACCELEROMETER; + accel->timestamp = timestamp; + accel->acceleration.x = accX; + accel->acceleration.y = accY; + accel->acceleration.z = accZ; +} + +/**************************************************************************/ +/*! + @brief Gets the accelerometer data rate. + @returns The the accelerometer data rate. +*/ +lsm6ds_data_rate_t Adafruit_LSM6DS::getAccelDataRate(void) { + + Adafruit_BusIO_Register ctrl1 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL1_XL); + + Adafruit_BusIO_RegisterBits accel_data_rate = + Adafruit_BusIO_RegisterBits(&ctrl1, 4, 4); + + return (lsm6ds_data_rate_t)accel_data_rate.read(); +} + +/**************************************************************************/ +/*! + @brief Sets the accelerometer data rate. + @param data_rate + The the accelerometer data rate. Must be a `lsm6ds_data_rate_t`. +*/ +void Adafruit_LSM6DS::setAccelDataRate(lsm6ds_data_rate_t data_rate) { + + Adafruit_BusIO_Register ctrl1 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL1_XL); + + Adafruit_BusIO_RegisterBits accel_data_rate = + Adafruit_BusIO_RegisterBits(&ctrl1, 4, 4); + + accel_data_rate.write(data_rate); +} + +/**************************************************************************/ +/*! + @brief Gets the accelerometer measurement range. + @returns The the accelerometer measurement range. +*/ +lsm6ds_accel_range_t Adafruit_LSM6DS::getAccelRange(void) { + + Adafruit_BusIO_Register ctrl1 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL1_XL); + + Adafruit_BusIO_RegisterBits accel_range = + Adafruit_BusIO_RegisterBits(&ctrl1, 2, 2); + + accelRangeBuffered = (lsm6ds_accel_range_t)accel_range.read(); + + return accelRangeBuffered; +} +/**************************************************************************/ +/*! + @brief Sets the accelerometer measurement range. + @param new_range The `lsm6ds_accel_range_t` range to set. +*/ +void Adafruit_LSM6DS::setAccelRange(lsm6ds_accel_range_t new_range) { + + Adafruit_BusIO_Register ctrl1 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL1_XL); + + Adafruit_BusIO_RegisterBits accel_range = + Adafruit_BusIO_RegisterBits(&ctrl1, 2, 2); + + accel_range.write(new_range); + + accelRangeBuffered = new_range; +} + +/**************************************************************************/ +/*! + @brief Gets the gyro data rate. + @returns The the gyro data rate. +*/ +lsm6ds_data_rate_t Adafruit_LSM6DS::getGyroDataRate(void) { + + Adafruit_BusIO_Register ctrl2 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL2_G); + + Adafruit_BusIO_RegisterBits gyro_data_rate = + Adafruit_BusIO_RegisterBits(&ctrl2, 4, 4); + + return (lsm6ds_data_rate_t)gyro_data_rate.read(); +} + +/**************************************************************************/ +/*! + @brief Sets the gyro data rate. + @param data_rate + The the gyro data rate. Must be a `lsm6ds_data_rate_t`. +*/ +void Adafruit_LSM6DS::setGyroDataRate(lsm6ds_data_rate_t data_rate) { + + Adafruit_BusIO_Register ctrl2 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL2_G); + + Adafruit_BusIO_RegisterBits gyro_data_rate = + Adafruit_BusIO_RegisterBits(&ctrl2, 4, 4); + + gyro_data_rate.write(data_rate); +} + +/**************************************************************************/ +/*! + @brief Gets the gyro range. + @returns The the gyro range. +*/ +lsm6ds_gyro_range_t Adafruit_LSM6DS::getGyroRange(void) { + + Adafruit_BusIO_Register ctrl2 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL2_G); + + Adafruit_BusIO_RegisterBits gyro_range = + Adafruit_BusIO_RegisterBits(&ctrl2, 4, 0); + + gyroRangeBuffered = (lsm6ds_gyro_range_t)gyro_range.read(); + + return gyroRangeBuffered; +} + +/**************************************************************************/ +/*! + @brief Sets the gyro range. + @param new_range The `lsm6ds_gyro_range_t` to set. +*/ +void Adafruit_LSM6DS::setGyroRange(lsm6ds_gyro_range_t new_range) { + + Adafruit_BusIO_Register ctrl2 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL2_G); + + Adafruit_BusIO_RegisterBits gyro_range = + Adafruit_BusIO_RegisterBits(&ctrl2, 4, 0); + + gyro_range.write(new_range); + + gyroRangeBuffered = new_range; +} + +/**************************************************************************/ +/*! + @brief Enables the high pass filter and/or slope filter + @param filter_enabled Whether to enable the slope filter (see datasheet) + @param filter The lsm6ds_hp_filter_t that sets the data rate divisor +*/ +/**************************************************************************/ +void Adafruit_LSM6DS::highPassFilter(bool filter_enabled, + lsm6ds_hp_filter_t filter) { + Adafruit_BusIO_Register ctrl8 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL8_XL); + Adafruit_BusIO_RegisterBits HPF_en = + Adafruit_BusIO_RegisterBits(&ctrl8, 1, 2); + Adafruit_BusIO_RegisterBits HPF_filter = + Adafruit_BusIO_RegisterBits(&ctrl8, 2, 5); + HPF_en.write(filter_enabled); + HPF_filter.write(filter); +} + +/******************* Adafruit_Sensor functions *****************/ +/*! + * @brief Updates the measurement data for all sensors simultaneously + */ +/**************************************************************************/ +void Adafruit_LSM6DS::_read(void) { + // get raw readings + Adafruit_BusIO_Register data_reg = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_OUT_TEMP_L, 14); + + uint8_t buffer[14]; + data_reg.read(buffer, 14); + + rawTemp = buffer[1] << 8 | buffer[0]; + temperature = (rawTemp / temperature_sensitivity) + 25.0; + + rawGyroX = buffer[3] << 8 | buffer[2]; + rawGyroY = buffer[5] << 8 | buffer[4]; + rawGyroZ = buffer[7] << 8 | buffer[6]; + + rawAccX = buffer[9] << 8 | buffer[8]; + rawAccY = buffer[11] << 8 | buffer[10]; + rawAccZ = buffer[13] << 8 | buffer[12]; + + float gyro_scale = 1; // range is in milli-dps per bit! + switch (gyroRangeBuffered) { + case ISM330DHCX_GYRO_RANGE_4000_DPS: + gyro_scale = 140.0; + break; + case LSM6DS_GYRO_RANGE_2000_DPS: + gyro_scale = 70.0; + break; + case LSM6DS_GYRO_RANGE_1000_DPS: + gyro_scale = 35.0; + break; + case LSM6DS_GYRO_RANGE_500_DPS: + gyro_scale = 17.50; + break; + case LSM6DS_GYRO_RANGE_250_DPS: + gyro_scale = 8.75; + break; + case LSM6DS_GYRO_RANGE_125_DPS: + gyro_scale = 4.375; + break; + } + + gyroX = rawGyroX * gyro_scale * SENSORS_DPS_TO_RADS / 1000.0; + gyroY = rawGyroY * gyro_scale * SENSORS_DPS_TO_RADS / 1000.0; + gyroZ = rawGyroZ * gyro_scale * SENSORS_DPS_TO_RADS / 1000.0; + + float accel_scale = 1; // range is in milli-g per bit! + switch (accelRangeBuffered) { + case LSM6DS_ACCEL_RANGE_16_G: + accel_scale = 0.488; + break; + case LSM6DS_ACCEL_RANGE_8_G: + accel_scale = 0.244; + break; + case LSM6DS_ACCEL_RANGE_4_G: + accel_scale = 0.122; + break; + case LSM6DS_ACCEL_RANGE_2_G: + accel_scale = 0.061; + break; + } + + accX = rawAccX * accel_scale * SENSORS_GRAVITY_STANDARD / 1000; + accY = rawAccY * accel_scale * SENSORS_GRAVITY_STANDARD / 1000; + accZ = rawAccZ * accel_scale * SENSORS_GRAVITY_STANDARD / 1000; +} + +/**************************************************************************/ +/*! + @brief Sets the INT1 and INT2 pin activation mode + @param active_low true to set the pins as active high, false to set the + mode to active low + @param open_drain true to set the pin mode as open-drain, false to set the + mode to push-pull +*/ +void Adafruit_LSM6DS::configIntOutputs(bool active_low, bool open_drain) { + + Adafruit_BusIO_Register ctrl3 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL3_C); + Adafruit_BusIO_RegisterBits ppod_bits = + Adafruit_BusIO_RegisterBits(&ctrl3, 2, 4); + + ppod_bits.write((active_low << 1) | open_drain); +} + +/**************************************************************************/ +/*! + @brief Enables and disables the data ready interrupt on INT 1. + @param drdy_temp true to output the data ready temperature interrupt + @param drdy_g true to output the data ready gyro interrupt + @param drdy_xl true to output the data ready accelerometer interrupt + @param step_detect true to output the step detection interrupt (default off) + @param wakeup true to output the wake up interrupt (default off) +*/ +void Adafruit_LSM6DS::configInt1(bool drdy_temp, bool drdy_g, bool drdy_xl, + bool step_detect, bool wakeup) { + + Adafruit_BusIO_Register int1_ctrl = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_INT1_CTRL); + + int1_ctrl.write((step_detect << 7) | (drdy_temp << 2) | (drdy_g << 1) | + drdy_xl); + + Adafruit_BusIO_Register md1cfg = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_MD1_CFG); + + Adafruit_BusIO_RegisterBits wu = Adafruit_BusIO_RegisterBits(&md1cfg, 1, 5); + wu.write(wakeup); +} + +/**************************************************************************/ +/*! + @brief Enables and disables the data ready interrupt on INT 2. + @param drdy_temp true to output the data ready temperature interrupt + @param drdy_g true to output the data ready gyro interrupt + @param drdy_xl true to output the data ready accelerometer interrupt +*/ +void Adafruit_LSM6DS::configInt2(bool drdy_temp, bool drdy_g, bool drdy_xl) { + + Adafruit_BusIO_Register int2_ctrl = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_INT2_CTRL); + + Adafruit_BusIO_RegisterBits int2_drdy_bits = + Adafruit_BusIO_RegisterBits(&int2_ctrl, 3, 0); + + int2_drdy_bits.write((drdy_temp << 2) | (drdy_g << 1) | drdy_xl); +} + +/**************************************************************************/ +/*! + @brief Gets the sensor_t data for the LSM6DS's gyroscope sensor +*/ +/**************************************************************************/ +void Adafruit_LSM6DS_Gyro::getSensor(sensor_t *sensor) { + /* Clear the sensor_t object */ + memset(sensor, 0, sizeof(sensor_t)); + + /* Insert the sensor name in the fixed length char array */ + strncpy(sensor->name, "LSM6DS_G", sizeof(sensor->name) - 1); + sensor->name[sizeof(sensor->name) - 1] = 0; + sensor->version = 1; + sensor->sensor_id = _sensorID; + sensor->type = SENSOR_TYPE_GYROSCOPE; + sensor->min_delay = 0; + sensor->min_value = -34.91; /* -2000 dps -> rad/s (radians per second) */ + sensor->max_value = +34.91; + sensor->resolution = 7.6358e-5; /* 4.375 mdps -> rad/s */ +} + +/**************************************************************************/ +/*! + @brief Gets the gyroscope as a standard sensor event + @param event Sensor event object that will be populated + @returns True +*/ +/**************************************************************************/ +bool Adafruit_LSM6DS_Gyro::getEvent(sensors_event_t *event) { + _theLSM6DS->_read(); + _theLSM6DS->fillGyroEvent(event, millis()); + + return true; +} + +/**************************************************************************/ +/*! + @brief Gets the sensor_t data for the LSM6DS's accelerometer +*/ +/**************************************************************************/ +void Adafruit_LSM6DS_Accelerometer::getSensor(sensor_t *sensor) { + /* Clear the sensor_t object */ + memset(sensor, 0, sizeof(sensor_t)); + + /* Insert the sensor name in the fixed length char array */ + strncpy(sensor->name, "LSM6DS_A", sizeof(sensor->name) - 1); + sensor->name[sizeof(sensor->name) - 1] = 0; + sensor->version = 1; + sensor->sensor_id = _sensorID; + sensor->type = SENSOR_TYPE_ACCELEROMETER; + sensor->min_delay = 0; + sensor->min_value = -156.9064F; /* -16g = 156.9064 m/s^2 */ + sensor->max_value = 156.9064F; /* 16g = 156.9064 m/s^2 */ + sensor->resolution = 0.061; /* 0.061 mg/LSB at +-2g */ +} + +/**************************************************************************/ +/*! + @brief Gets the accelerometer as a standard sensor event + @param event Sensor event object that will be populated + @returns True +*/ +/**************************************************************************/ +bool Adafruit_LSM6DS_Accelerometer::getEvent(sensors_event_t *event) { + _theLSM6DS->_read(); + _theLSM6DS->fillAccelEvent(event, millis()); + + return true; +} + +/**************************************************************************/ +/*! + @brief Gets the sensor_t data for the LSM6DS's tenperature +*/ +/**************************************************************************/ +void Adafruit_LSM6DS_Temp::getSensor(sensor_t *sensor) { + /* Clear the sensor_t object */ + memset(sensor, 0, sizeof(sensor_t)); + + /* Insert the sensor name in the fixed length char array */ + strncpy(sensor->name, "LSM6DS_T", sizeof(sensor->name) - 1); + sensor->name[sizeof(sensor->name) - 1] = 0; + sensor->version = 1; + sensor->sensor_id = _sensorID; + sensor->type = SENSOR_TYPE_AMBIENT_TEMPERATURE; + sensor->min_delay = 0; + sensor->min_value = -40; + sensor->max_value = 85; + sensor->resolution = 1; /* not a great sensor */ +} + +/**************************************************************************/ +/*! + @brief Gets the temperature as a standard sensor event + @param event Sensor event object that will be populated + @returns True +*/ +/**************************************************************************/ +bool Adafruit_LSM6DS_Temp::getEvent(sensors_event_t *event) { + _theLSM6DS->_read(); + _theLSM6DS->fillTempEvent(event, millis()); + + return true; +} + +/**************************************************************************/ +/*! + @brief Enables and disables the pedometer function + @param enable True to turn on the pedometer function, false to turn off +*/ +/**************************************************************************/ +void Adafruit_LSM6DS::enablePedometer(bool enable) { + // enable or disable step counter + Adafruit_BusIO_Register tapcfg = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_TAP_CFG); + Adafruit_BusIO_RegisterBits pedo_en = + Adafruit_BusIO_RegisterBits(&tapcfg, 1, 6); + pedo_en.write(enable); + + // enable or disable functionality + Adafruit_BusIO_Register ctrl10 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL10_C); + Adafruit_BusIO_RegisterBits func_en = + Adafruit_BusIO_RegisterBits(&ctrl10, 1, 2); + func_en.write(enable); + + resetPedometer(); +} + +/**************************************************************************/ +/*! + @brief Enables and disables the wakeup function + @param enable True to turn on the wakeup function, false to turn off + @param duration How many > threshold readings to generate a wakeup + @param thresh The threshold (sensitivity) +*/ +/**************************************************************************/ +void Adafruit_LSM6DS::enableWakeup(bool enable, uint8_t duration, + uint8_t thresh) { + // enable or disable functionality + Adafruit_BusIO_Register tapcfg = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_TAP_CFG); + Adafruit_BusIO_RegisterBits slope_en = + Adafruit_BusIO_RegisterBits(&tapcfg, 1, 4); + Adafruit_BusIO_RegisterBits timer_en = + Adafruit_BusIO_RegisterBits(&tapcfg, 1, 7); + slope_en.write(enable); + timer_en.write(enable); + if (enable) { + Adafruit_BusIO_Register wake_dur = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_WAKEUP_DUR); + Adafruit_BusIO_RegisterBits durbits = + Adafruit_BusIO_RegisterBits(&wake_dur, 2, 5); + durbits.write(duration); + + Adafruit_BusIO_Register wake_ths = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_WAKEUP_THS); + Adafruit_BusIO_RegisterBits thsbits = + Adafruit_BusIO_RegisterBits(&wake_ths, 6, 0); + thsbits.write(thresh); + } +} + +/**************************************************************************/ +/*! + @brief Checks interrupt register to see if we have a wake signal + @returns True if wake event bit is set in WAKEUP_SRC (cleared on read) +*/ +/**************************************************************************/ +bool Adafruit_LSM6DS::awake(void) { + Adafruit_BusIO_Register wakesrc = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_WAKEUP_SRC); + Adafruit_BusIO_RegisterBits wake_evt = + Adafruit_BusIO_RegisterBits(&wakesrc, 1, 3); + return wake_evt.read(); +} + +/**************************************************************************/ +/*! + @brief Simple shake detection. Must call enableWakeup() first. + @returns True if shake (wake) detected, otherwise false. +*/ +/**************************************************************************/ +bool Adafruit_LSM6DS::shake(void) { + Adafruit_BusIO_Register tapcfg = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_TAP_CFG); + Adafruit_BusIO_RegisterBits slope_en = + Adafruit_BusIO_RegisterBits(&tapcfg, 1, 4); + Adafruit_BusIO_RegisterBits timer_en = + Adafruit_BusIO_RegisterBits(&tapcfg, 1, 7); + // only check if enabled + if (slope_en.read() && timer_en.read()) { + return awake(); + } + return false; +} + +/**************************************************************************/ +/*! + @brief Reset the pedometer count +*/ +/**************************************************************************/ +void Adafruit_LSM6DS::resetPedometer(void) { + // reset bit to clear counter + Adafruit_BusIO_Register ctrl10 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL10_C); + Adafruit_BusIO_RegisterBits ped_rst = + Adafruit_BusIO_RegisterBits(&ctrl10, 1, 1); + ped_rst.write(true); +} + +/**************************************************************************/ +/*! + @brief Read the 16-bit pedometer count + @returns The value from the step counter +*/ +/**************************************************************************/ +uint16_t Adafruit_LSM6DS::readPedometer(void) { + Adafruit_BusIO_Register steps_reg = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_STEPCOUNTER, 2); + return steps_reg.read(); +} + +/**************************************************************************/ +/*! + @brief Gets the accelerometer data rate. + @returns The data rate in float +*/ +float Adafruit_LSM6DS::accelerationSampleRate(void) { + return _data_rate_arr[this->getAccelDataRate()]; +} + +/**************************************************************************/ +/*! + @brief Check for available data from accelerometer + @returns 1 if available, 0 if not +*/ +int Adafruit_LSM6DS::accelerationAvailable(void) { + return (this->status() & 0x01) ? 1 : 0; +} + +/**************************************************************************/ +/*! + @brief Read accelerometer data + @param x reference to x axis + @param y reference to y axis + @param z reference to z axis + @returns 1 if success, 0 if not +*/ +int Adafruit_LSM6DS::readAcceleration(float &x, float &y, float &z) { + int16_t data[3]; + + Adafruit_BusIO_Register accel_data = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_OUTX_L_A, 6); + + if (!accel_data.read((uint8_t *)data, sizeof(data))) { + x = y = z = NAN; + return 0; + } + + // scale to range of -4 – 4 + x = data[0] * 4.0 / 32768.0; + y = data[1] * 4.0 / 32768.0; + z = data[2] * 4.0 / 32768.0; + + return 1; +} + +/**************************************************************************/ +/*! + @brief Get the gyroscope data rate. + @returns The data rate in float +*/ +float Adafruit_LSM6DS::gyroscopeSampleRate(void) { + return _data_rate_arr[this->getGyroDataRate()]; +} + +/**************************************************************************/ +/*! + @brief Check for available data from gyroscope + @returns 1 if available, 0 if not +*/ +int Adafruit_LSM6DS::gyroscopeAvailable(void) { + return (this->status() & 0x02) ? 1 : 0; +} + +/**************************************************************************/ +/*! + @brief Read gyroscope data + @param x reference to x axis + @param y reference to y axis + @param z reference to z axis + @returns 1 if success, 0 if not +*/ +int Adafruit_LSM6DS::readGyroscope(float &x, float &y, float &z) { + int16_t data[3]; + + Adafruit_BusIO_Register gyro_data = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_OUTX_L_G, 6); + + if (!gyro_data.read((uint8_t *)data, sizeof(data))) { + x = y = z = NAN; + return 0; + } + + // scale to range of -2000 – 2000 + x = data[0] * 2000.0 / 32768.0; + y = data[1] * 2000.0 / 32768.0; + z = data[2] * 2000.0 / 32768.0; + + return 1; +} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS.h b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS.h new file mode 100644 index 0000000..bad4eaa --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS.h @@ -0,0 +1,251 @@ +/*! + * @file Adafruit_LSM6DS.h + * + * I2C Driver base for Adafruit LSM6DSxx 6-DoF Accelerometer and Gyroscope + * library + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing products + *from Adafruit! + * + * BSD license (see license.txt) + */ + +#ifndef _ADAFRUIT_LSM6DS_H +#define _ADAFRUIT_LSM6DS_H + +#include "Arduino.h" +#include +#include +#include +#include + +#define LSM6DS_I2CADDR_DEFAULT 0x6A ///< LSM6DS default i2c address + +#define LSM6DS_FUNC_CFG_ACCESS 0x1 ///< Enable embedded functions register +#define LSM6DS_INT1_CTRL 0x0D ///< Interrupt control for INT 1 +#define LSM6DS_INT2_CTRL 0x0E ///< Interrupt control for INT 2 +#define LSM6DS_WHOAMI 0x0F ///< Chip ID register +#define LSM6DS_CTRL1_XL 0x10 ///< Main accelerometer config register +#define LSM6DS_CTRL2_G 0x11 ///< Main gyro config register +#define LSM6DS_CTRL3_C 0x12 ///< Main configuration register +#define LSM6DS_CTRL8_XL 0x17 ///< High and low pass for accel +#define LSM6DS_CTRL10_C 0x19 ///< Main configuration register +#define LSM6DS_WAKEUP_SRC 0x1B ///< Why we woke up +#define LSM6DS_STATUS_REG 0X1E ///< Status register +#define LSM6DS_OUT_TEMP_L 0x20 ///< First data register (temperature low) +#define LSM6DS_OUTX_L_G 0x22 ///< First gyro data register +#define LSM6DS_OUTX_L_A 0x28 ///< First accel data register +#define LSM6DS_STEPCOUNTER 0x4B ///< 16-bit step counter +#define LSM6DS_TAP_CFG 0x58 ///< Tap/pedometer configuration +#define LSM6DS_WAKEUP_THS \ + 0x5B ///< Single and double-tap function threshold register +#define LSM6DS_WAKEUP_DUR \ + 0x5C ///< Free-fall, wakeup, timestamp and sleep mode duration +#define LSM6DS_MD1_CFG 0x5E ///< Functions routing on INT1 register + +/** The accelerometer data rate */ +typedef enum data_rate { + LSM6DS_RATE_SHUTDOWN, + LSM6DS_RATE_12_5_HZ, + LSM6DS_RATE_26_HZ, + LSM6DS_RATE_52_HZ, + LSM6DS_RATE_104_HZ, + LSM6DS_RATE_208_HZ, + LSM6DS_RATE_416_HZ, + LSM6DS_RATE_833_HZ, + LSM6DS_RATE_1_66K_HZ, + LSM6DS_RATE_3_33K_HZ, + LSM6DS_RATE_6_66K_HZ, +} lsm6ds_data_rate_t; + +/** The accelerometer data range */ +typedef enum accel_range { + LSM6DS_ACCEL_RANGE_2_G, + LSM6DS_ACCEL_RANGE_16_G, + LSM6DS_ACCEL_RANGE_4_G, + LSM6DS_ACCEL_RANGE_8_G +} lsm6ds_accel_range_t; + +/** The gyro data range */ +typedef enum gyro_range { + LSM6DS_GYRO_RANGE_125_DPS = 0b0010, + LSM6DS_GYRO_RANGE_250_DPS = 0b0000, + LSM6DS_GYRO_RANGE_500_DPS = 0b0100, + LSM6DS_GYRO_RANGE_1000_DPS = 0b1000, + LSM6DS_GYRO_RANGE_2000_DPS = 0b1100, + ISM330DHCX_GYRO_RANGE_4000_DPS = 0b0001 +} lsm6ds_gyro_range_t; + +/** The high pass filter bandwidth */ +typedef enum hpf_range { + LSM6DS_HPF_ODR_DIV_50 = 0, + LSM6DS_HPF_ODR_DIV_100 = 1, + LSM6DS_HPF_ODR_DIV_9 = 2, + LSM6DS_HPF_ODR_DIV_400 = 3, +} lsm6ds_hp_filter_t; + +class Adafruit_LSM6DS; + +/** Adafruit Unified Sensor interface for temperature component of LSM6DS */ +class Adafruit_LSM6DS_Temp : public Adafruit_Sensor { +public: + /** @brief Create an Adafruit_Sensor compatible object for the temp sensor + @param parent A pointer to the LSM6DS class */ + Adafruit_LSM6DS_Temp(Adafruit_LSM6DS *parent) { _theLSM6DS = parent; } + bool getEvent(sensors_event_t *); + void getSensor(sensor_t *); + +private: + int _sensorID = 0x6D0; + Adafruit_LSM6DS *_theLSM6DS = NULL; +}; + +/** Adafruit Unified Sensor interface for accelerometer component of LSM6DS */ +class Adafruit_LSM6DS_Accelerometer : public Adafruit_Sensor { +public: + /** @brief Create an Adafruit_Sensor compatible object for the accelerometer + sensor + @param parent A pointer to the LSM6DS class */ + Adafruit_LSM6DS_Accelerometer(Adafruit_LSM6DS *parent) { + _theLSM6DS = parent; + } + bool getEvent(sensors_event_t *); + void getSensor(sensor_t *); + +private: + int _sensorID = 0x6D1; + Adafruit_LSM6DS *_theLSM6DS = NULL; +}; + +/** Adafruit Unified Sensor interface for gyro component of LSM6DS */ +class Adafruit_LSM6DS_Gyro : public Adafruit_Sensor { +public: + /** @brief Create an Adafruit_Sensor compatible object for the gyro sensor + @param parent A pointer to the LSM6DS class */ + Adafruit_LSM6DS_Gyro(Adafruit_LSM6DS *parent) { _theLSM6DS = parent; } + bool getEvent(sensors_event_t *); + void getSensor(sensor_t *); + +private: + int _sensorID = 0x6D2; + Adafruit_LSM6DS *_theLSM6DS = NULL; +}; + +/*! + * @brief Class that stores state and functions for interacting with + * the LSM6DS I2C Accel/Gyro + */ +class Adafruit_LSM6DS { +public: + Adafruit_LSM6DS(); + virtual ~Adafruit_LSM6DS(); + + bool begin_I2C(uint8_t i2c_addr = LSM6DS_I2CADDR_DEFAULT, + TwoWire *wire = &Wire, int32_t sensorID = 0); + + bool begin_SPI(uint8_t cs_pin, SPIClass *theSPI = &SPI, int32_t sensorID = 0, + uint32_t frequency = 1000000); + bool begin_SPI(int8_t cs_pin, int8_t sck_pin, int8_t miso_pin, + int8_t mosi_pin, int32_t sensorID = 0, + uint32_t frequency = 1000000); + + bool getEvent(sensors_event_t *accel, sensors_event_t *gyro, + sensors_event_t *temp); + + lsm6ds_data_rate_t getAccelDataRate(void); + void setAccelDataRate(lsm6ds_data_rate_t data_rate); + + lsm6ds_accel_range_t getAccelRange(void); + void setAccelRange(lsm6ds_accel_range_t new_range); + + lsm6ds_data_rate_t getGyroDataRate(void); + void setGyroDataRate(lsm6ds_data_rate_t data_rate); + + lsm6ds_gyro_range_t getGyroRange(void); + void setGyroRange(lsm6ds_gyro_range_t new_range); + + void reset(void); + void configIntOutputs(bool active_low, bool open_drain); + void configInt1(bool drdy_temp, bool drdy_g, bool drdy_xl, + bool step_detect = false, bool wakeup = false); + void configInt2(bool drdy_temp, bool drdy_g, bool drdy_xl); + void highPassFilter(bool enabled, lsm6ds_hp_filter_t filter); + + void enableWakeup(bool enable, uint8_t duration = 0, uint8_t thresh = 20); + bool awake(void); + bool shake(void); + + void enablePedometer(bool enable); + void resetPedometer(void); + uint16_t readPedometer(void); + + // Arduino compatible API + int readAcceleration(float &x, float &y, float &z); + float accelerationSampleRate(void); + int accelerationAvailable(void); + + int readGyroscope(float &x, float &y, float &z); + float gyroscopeSampleRate(void); + int gyroscopeAvailable(void); + + int16_t rawAccX, ///< Last reading's raw accelerometer X axis + rawAccY, ///< Last reading's raw accelerometer Y axis + rawAccZ, ///< Last reading's raw accelerometer Z axis + rawTemp, ///< Last reading's raw temperature reading + rawGyroX, ///< Last reading's raw gyro X axis + rawGyroY, ///< Last reading's raw gyro Y axis + rawGyroZ; ///< Last reading's raw gyro Z axis + + float temperature, ///< Last reading's temperature (C) + accX, ///< Last reading's accelerometer X axis m/s^2 + accY, ///< Last reading's accelerometer Y axis m/s^2 + accZ, ///< Last reading's accelerometer Z axis m/s^2 + gyroX, ///< Last reading's gyro X axis in rad/s + gyroY, ///< Last reading's gyro Y axis in rad/s + gyroZ; ///< Last reading's gyro Z axis in rad/s + + Adafruit_Sensor *getTemperatureSensor(void); + Adafruit_Sensor *getAccelerometerSensor(void); + Adafruit_Sensor *getGyroSensor(void); + +protected: + uint8_t chipID(void); + uint8_t status(void); + virtual void _read(void); + virtual bool _init(int32_t sensor_id); + + uint16_t _sensorid_accel, ///< ID number for accelerometer + _sensorid_gyro, ///< ID number for gyro + _sensorid_temp; ///< ID number for temperature + + Adafruit_I2CDevice *i2c_dev = NULL; ///< Pointer to I2C bus interface + Adafruit_SPIDevice *spi_dev = NULL; ///< Pointer to SPI bus interface + + float temperature_sensitivity = + 256.0; ///< Temp sensor sensitivity in LSB/degC + Adafruit_LSM6DS_Temp *temp_sensor = NULL; ///< Temp sensor data object + Adafruit_LSM6DS_Accelerometer *accel_sensor = + NULL; ///< Accelerometer data object + Adafruit_LSM6DS_Gyro *gyro_sensor = NULL; ///< Gyro data object + + //! buffer for the accelerometer range + lsm6ds_accel_range_t accelRangeBuffered = LSM6DS_ACCEL_RANGE_2_G; + //! buffer for the gyroscope range + lsm6ds_gyro_range_t gyroRangeBuffered = LSM6DS_GYRO_RANGE_250_DPS; + +private: + friend class Adafruit_LSM6DS_Temp; ///< Gives access to private members to + ///< Temp data object + friend class Adafruit_LSM6DS_Accelerometer; ///< Gives access to private + ///< members to Accelerometer data + ///< object + friend class Adafruit_LSM6DS_Gyro; ///< Gives access to private members to + ///< Gyro data object + + void fillTempEvent(sensors_event_t *temp, uint32_t timestamp); + void fillAccelEvent(sensors_event_t *accel, uint32_t timestamp); + void fillGyroEvent(sensors_event_t *gyro, uint32_t timestamp); +}; + +#endif diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3.cpp b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3.cpp new file mode 100644 index 0000000..ef91032 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3.cpp @@ -0,0 +1,51 @@ + +/*! + * @file Adafruit_LSM6DS3.cpp Adafruit LSM6DS3 6-DoF Accelerometer + * and Gyroscope library + * + * Bryan Siepert for Adafruit Industries + * BSD (see license.txt) + */ + +#include "Arduino.h" +#include + +#include "Adafruit_LSM6DS3.h" + +/*! + * @brief Instantiates a new LSM6DS3 class + */ +Adafruit_LSM6DS3::Adafruit_LSM6DS3(void) {} + +bool Adafruit_LSM6DS3::_init(int32_t sensor_id) { + // make sure we're talking to the right chip + if (chipID() != LSM6DS3_CHIP_ID) { + return false; + } + _sensorid_accel = sensor_id; + _sensorid_gyro = sensor_id + 1; + _sensorid_temp = sensor_id + 2; + + temperature_sensitivity = 16.0; + + reset(); + + // call base class _init() + Adafruit_LSM6DS::_init(sensor_id); + + return true; +} + +/**************************************************************************/ +/*! + @brief Enables and disables the I2C master bus pulllups. + @param enable_pullups true to enable the I2C pullups, false to disable. +*/ +void Adafruit_LSM6DS3::enableI2CMasterPullups(bool enable_pullups) { + Adafruit_BusIO_Register master_config = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS3_MASTER_CONFIG); + Adafruit_BusIO_RegisterBits i2c_master_pu_en = + Adafruit_BusIO_RegisterBits(&master_config, 1, 3); + + i2c_master_pu_en.write(enable_pullups); +} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3.h b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3.h new file mode 100644 index 0000000..ddf3ad7 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3.h @@ -0,0 +1,42 @@ +/*! + * @file Adafruit_LSM6DS3.h + * + * I2C Driver for the Adafruit LSM6DS3 6-DoF Accelerometer and Gyroscope + *library + * + * This is a library for the Adafruit LSM6DS3 breakout: + * https://www.adafruit.com/ + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing products from + * Adafruit! + * + * + * BSD license (see license.txt) + */ + +#ifndef _ADAFRUIT_LSM6DS3_H +#define _ADAFRUIT_LSM6DS3_H + +#include "Adafruit_LSM6DS.h" + +#define LSM6DS3_CHIP_ID 0x69 ///< LSM6DS3 default device id from WHOAMI + +#define LSM6DS3_MASTER_CONFIG 0x1A ///< I2C Master config + +/*! + * @brief Class that stores state and functions for interacting with + * the LSM6DS3 + */ +class Adafruit_LSM6DS3 : public Adafruit_LSM6DS { +public: + Adafruit_LSM6DS3(); + ~Adafruit_LSM6DS3(){}; + + void enableI2CMasterPullups(bool enable_pullups); + +private: + bool _init(int32_t sensor_id); +}; + +#endif diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS33.cpp b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS33.cpp new file mode 100644 index 0000000..711b4cf --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS33.cpp @@ -0,0 +1,40 @@ + +/*! + * @file Adafruit_LSM6DS33.cpp Adafruit LSM6DS33 6-DoF Accelerometer + * and Gyroscope library + * + * Bryan Siepert for Adafruit Industries + * BSD (see license.txt) + */ + +#include "Arduino.h" +#include + +#include "Adafruit_LSM6DS33.h" + +/*! + * @brief Instantiates a new LSM6DS33 class + */ +Adafruit_LSM6DS33::Adafruit_LSM6DS33(void) {} + +bool Adafruit_LSM6DS33::_init(int32_t sensor_id) { + // make sure we're talking to the right chip + if (chipID() != LSM6DS33_CHIP_ID) { + return false; + } + _sensorid_accel = sensor_id; + _sensorid_gyro = sensor_id + 1; + _sensorid_temp = sensor_id + 2; + + temperature_sensitivity = 16.0; + + reset(); + if (chipID() != LSM6DS33_CHIP_ID) { + return false; + } + + // call base class _init() + Adafruit_LSM6DS::_init(sensor_id); + + return true; +} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS33.h b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS33.h new file mode 100644 index 0000000..9ca2e5e --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS33.h @@ -0,0 +1,38 @@ +/*! + * @file Adafruit_LSM6DS33.h + * + * I2C Driver for the Adafruit LSM6DS33 6-DoF Accelerometer and Gyroscope + *library + * + * This is a library for the Adafruit LSM6DS33 breakout: + * https://www.adafruit.com/products/4480 + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing products from + * Adafruit! + * + * + * BSD license (see license.txt) + */ + +#ifndef _ADAFRUIT_LSM6DS33_H +#define _ADAFRUIT_LSM6DS33_H + +#include "Adafruit_LSM6DS.h" + +#define LSM6DS33_CHIP_ID 0x69 ///< LSM6DS33 default device id from WHOAMI + +/*! + * @brief Class that stores state and functions for interacting with + * the LSM6DS33 I2C Digital Potentiometer + */ +class Adafruit_LSM6DS33 : public Adafruit_LSM6DS { +public: + Adafruit_LSM6DS33(); + ~Adafruit_LSM6DS33(){}; + +private: + bool _init(int32_t sensor_id); +}; + +#endif diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3TRC.cpp b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3TRC.cpp new file mode 100644 index 0000000..949a238 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3TRC.cpp @@ -0,0 +1,71 @@ + +/*! + * @file Adafruit_LSM6DS3TRC.cpp Adafruit LSM6DS3TR-C 6-DoF Accelerometer + * and Gyroscope library + * + * Written by ladyada for Adafruit Industries + * BSD (see license.txt) + */ + +#include "Arduino.h" +#include + +#include "Adafruit_LSM6DS3TRC.h" + +/*! + * @brief Instantiates a new LSM6DS3TRC class + */ +Adafruit_LSM6DS3TRC::Adafruit_LSM6DS3TRC(void) {} + +bool Adafruit_LSM6DS3TRC::_init(int32_t sensor_id) { + // make sure we're talking to the right chip + if (chipID() != LSM6DS3TRC_CHIP_ID) { + return false; + } + _sensorid_accel = sensor_id; + _sensorid_gyro = sensor_id + 1; + _sensorid_temp = sensor_id + 2; + + reset(); + + // call base class _init() + Adafruit_LSM6DS::_init(sensor_id); + + return true; +} + +/**************************************************************************/ +/*! + @brief Enables and disables the pedometer function + @param enable True to turn on the pedometer function, false to turn off +*/ +/**************************************************************************/ +void Adafruit_LSM6DS3TRC::enablePedometer(bool enable) { + // enable or disable functionality + Adafruit_BusIO_Register ctrl10 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL10_C); + + Adafruit_BusIO_RegisterBits ped_en = + Adafruit_BusIO_RegisterBits(&ctrl10, 1, 4); + ped_en.write(enable); + + Adafruit_BusIO_RegisterBits func_en = + Adafruit_BusIO_RegisterBits(&ctrl10, 1, 2); + func_en.write(enable); + + resetPedometer(); +} + +/**************************************************************************/ +/*! + @brief Enables and disables the I2C master bus pulllups. + @param enable_pullups true to enable the I2C pullups, false to disable. +*/ +void Adafruit_LSM6DS3TRC::enableI2CMasterPullups(bool enable_pullups) { + Adafruit_BusIO_Register master_config = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS3TRC_MASTER_CONFIG); + Adafruit_BusIO_RegisterBits i2c_master_pu_en = + Adafruit_BusIO_RegisterBits(&master_config, 1, 3); + + i2c_master_pu_en.write(enable_pullups); +} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3TRC.h b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3TRC.h new file mode 100644 index 0000000..68326ba --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3TRC.h @@ -0,0 +1,43 @@ +/*! + * @file Adafruit_LSM6DSL.h + * + * I2C Driver for the Adafruit LSM6DSL 6-DoF Accelerometer and Gyroscope + *library + * + * This is a library for the Adafruit LSM6DSL breakout: + * https://www.adafruit.com/ + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing products from + * Adafruit! + * + * + * BSD license (see license.txt) + */ + +#ifndef _ADAFRUIT_LSM6DS3TRC_H +#define _ADAFRUIT_LSM6DS3TRC_H + +#include "Adafruit_LSM6DS.h" + +#define LSM6DS3TRC_CHIP_ID 0x6A ///< LSM6DSL default device id from WHOAMI + +#define LSM6DS3TRC_MASTER_CONFIG 0x1A ///< I2C Master config + +/*! + * @brief Class that stores state and functions for interacting with + * the LSM6DS3TRC + */ +class Adafruit_LSM6DS3TRC : public Adafruit_LSM6DS { +public: + Adafruit_LSM6DS3TRC(); + ~Adafruit_LSM6DS3TRC(){}; + + void enableI2CMasterPullups(bool enable_pullups); + void enablePedometer(bool enable); + +private: + bool _init(int32_t sensor_id); +}; + +#endif diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSL.cpp b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSL.cpp new file mode 100644 index 0000000..b751e9b --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSL.cpp @@ -0,0 +1,49 @@ + +/*! + * @file Adafruit_LSM6DSL.cpp Adafruit LSM6DSL 6-DoF Accelerometer + * and Gyroscope library + * + * Adapted by Eugene Anikin for Adafruit Industries + * BSD (see license.txt) + */ + +#include "Arduino.h" +#include + +#include "Adafruit_LSM6DSL.h" + +/*! + * @brief Instantiates a new LSM6DSL class + */ +Adafruit_LSM6DSL::Adafruit_LSM6DSL(void) {} + +bool Adafruit_LSM6DSL::_init(int32_t sensor_id) { + // make sure we're talking to the right chip + if (chipID() != LSM6DSL_CHIP_ID) { + return false; + } + _sensorid_accel = sensor_id; + _sensorid_gyro = sensor_id + 1; + _sensorid_temp = sensor_id + 2; + + reset(); + + // call base class _init() + Adafruit_LSM6DS::_init(sensor_id); + + return true; +} + +/**************************************************************************/ +/*! + @brief Enables and disables the I2C master bus pulllups. + @param enable_pullups true to enable the I2C pullups, false to disable. +*/ +void Adafruit_LSM6DSL::enableI2CMasterPullups(bool enable_pullups) { + Adafruit_BusIO_Register master_config = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DSL_MASTER_CONFIG); + Adafruit_BusIO_RegisterBits i2c_master_pu_en = + Adafruit_BusIO_RegisterBits(&master_config, 1, 3); + + i2c_master_pu_en.write(enable_pullups); +} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSL.h b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSL.h new file mode 100644 index 0000000..17649fd --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSL.h @@ -0,0 +1,42 @@ +/*! + * @file Adafruit_LSM6DSL.h + * + * I2C Driver for the Adafruit LSM6DSL 6-DoF Accelerometer and Gyroscope + *library + * + * This is a library for the Adafruit LSM6DSL breakout: + * https://www.adafruit.com/ + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing products from + * Adafruit! + * + * + * BSD license (see license.txt) + */ + +#ifndef _ADAFRUIT_LSM6DSL_H +#define _ADAFRUIT_LSM6DSL_H + +#include "Adafruit_LSM6DS.h" + +#define LSM6DSL_CHIP_ID 0x6A ///< LSM6DSL default device id from WHOAMI + +#define LSM6DSL_MASTER_CONFIG 0x1A ///< I2C Master config + +/*! + * @brief Class that stores state and functions for interacting with + * the LSM6DSL + */ +class Adafruit_LSM6DSL : public Adafruit_LSM6DS { +public: + Adafruit_LSM6DSL(); + ~Adafruit_LSM6DSL(){}; + + void enableI2CMasterPullups(bool enable_pullups); + +private: + bool _init(int32_t sensor_id); +}; + +#endif diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSO32.cpp b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSO32.cpp new file mode 100644 index 0000000..bbf8d1b --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSO32.cpp @@ -0,0 +1,143 @@ + +/*! + * @file Adafruit_LSM6DSO32.cpp + * Adafruit LSM6DSO32 6-DoF Accelerometer and Gyroscope library + * + * Bryan Siepert for Adafruit Industries + * BSD (see license.txt) + */ + +#include "Arduino.h" +#include + +#include "Adafruit_LSM6DSO32.h" +#include "Adafruit_LSM6DSOX.h" + +/*! + * @brief Instantiates a new LSM6DSO32 class + */ +Adafruit_LSM6DSO32::Adafruit_LSM6DSO32(void) {} + +bool Adafruit_LSM6DSO32::_init(int32_t sensor_id) { + Adafruit_BusIO_Register chip_id = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_WHOAMI); + + // make sure we're talking to the right chip + if (chip_id.read() != LSM6DSO32_CHIP_ID) { + return false; + } + _sensorid_accel = sensor_id; + _sensorid_gyro = sensor_id + 1; + _sensorid_temp = sensor_id + 2; + + reset(); + + Adafruit_BusIO_Register ctrl3 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DSOX_CTRL3_C); + Adafruit_BusIO_RegisterBits bdu = Adafruit_BusIO_RegisterBits(&ctrl3, 1, 6); + bdu.write(true); + + // Disable I3C + Adafruit_BusIO_Register ctrl_9 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DSOX_CTRL9_XL); + Adafruit_BusIO_RegisterBits i3c_disable_bit = + Adafruit_BusIO_RegisterBits(&ctrl_9, 1, 1); + + i3c_disable_bit.write(true); + + // call base class _init() + Adafruit_LSM6DS::_init(sensor_id); + + return true; +} + +/******************* Adafruit_Sensor functions *****************/ +/*! + * @brief Updates the measurement data for all sensors simultaneously + */ +/**************************************************************************/ +// works for now, should refactor +void Adafruit_LSM6DSO32::_read(void) { + // get raw readings + Adafruit_BusIO_Register data_reg = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_OUT_TEMP_L, 14); + + uint8_t buffer[14]; + data_reg.read(buffer, 14); + + rawTemp = buffer[1] << 8 | buffer[0]; + temperature = (rawTemp / 256.0) + 25.0; + + rawGyroX = buffer[3] << 8 | buffer[2]; + rawGyroY = buffer[5] << 8 | buffer[4]; + rawGyroZ = buffer[7] << 8 | buffer[6]; + + rawAccX = buffer[9] << 8 | buffer[8]; + rawAccY = buffer[11] << 8 | buffer[10]; + rawAccZ = buffer[13] << 8 | buffer[12]; + + lsm6ds_gyro_range_t gyro_range = getGyroRange(); + float gyro_scale = 1; // range is in milli-dps per bit! + if (gyro_range == ISM330DHCX_GYRO_RANGE_4000_DPS) + gyro_scale = 140.0; + if (gyro_range == LSM6DS_GYRO_RANGE_2000_DPS) + gyro_scale = 70.0; + if (gyro_range == LSM6DS_GYRO_RANGE_1000_DPS) + gyro_scale = 35.0; + if (gyro_range == LSM6DS_GYRO_RANGE_500_DPS) + gyro_scale = 17.50; + if (gyro_range == LSM6DS_GYRO_RANGE_250_DPS) + gyro_scale = 8.75; + if (gyro_range == LSM6DS_GYRO_RANGE_125_DPS) + gyro_scale = 4.375; + + gyroX = rawGyroX * gyro_scale * SENSORS_DPS_TO_RADS / 1000.0; + gyroY = rawGyroY * gyro_scale * SENSORS_DPS_TO_RADS / 1000.0; + gyroZ = rawGyroZ * gyro_scale * SENSORS_DPS_TO_RADS / 1000.0; + + lsm6dso32_accel_range_t accel_range = getAccelRange(); + float accel_scale = 1; // range is in milli-g per bit! + if (accel_range == LSM6DSO32_ACCEL_RANGE_32_G) + accel_scale = 0.976; + if (accel_range == LSM6DSO32_ACCEL_RANGE_16_G) + accel_scale = 0.488; + if (accel_range == LSM6DSO32_ACCEL_RANGE_8_G) + accel_scale = 0.244; + if (accel_range == LSM6DSO32_ACCEL_RANGE_4_G) + accel_scale = 0.122; + accX = rawAccX * accel_scale * SENSORS_GRAVITY_STANDARD / 1000; + accY = rawAccY * accel_scale * SENSORS_GRAVITY_STANDARD / 1000; + accZ = rawAccZ * accel_scale * SENSORS_GRAVITY_STANDARD / 1000; +} + +/**************************************************************************/ +/*! + @brief Gets the accelerometer measurement range. + @returns The the accelerometer measurement range. +*/ +lsm6dso32_accel_range_t Adafruit_LSM6DSO32::getAccelRange(void) { + + Adafruit_BusIO_Register ctrl1 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL1_XL); + + Adafruit_BusIO_RegisterBits accel_range = + Adafruit_BusIO_RegisterBits(&ctrl1, 2, 2); + + return (lsm6dso32_accel_range_t)accel_range.read(); +} +/**************************************************************************/ +/*! + @brief Sets the accelerometer measurement range. + @param new_range The `lsm6dso32_accel_range_t` range to set. +*/ +void Adafruit_LSM6DSO32::setAccelRange(lsm6dso32_accel_range_t new_range) { + + Adafruit_BusIO_Register ctrl1 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL1_XL); + + Adafruit_BusIO_RegisterBits accel_range = + Adafruit_BusIO_RegisterBits(&ctrl1, 2, 2); + + accel_range.write(new_range); + delay(20); +} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSO32.h b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSO32.h new file mode 100644 index 0000000..c0ecbd0 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSO32.h @@ -0,0 +1,49 @@ +/*! + * @file Adafruit_LSM6DSO32.h + * + * I2C Driver for the Adafruit LSM6DSO32 6-DoF Accelerometer and Gyroscope + *library + * + * This is a library for the Adafruit LSM6DSO32 breakout: + * https://www.adafruit.com/products/PID_HERE + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing products from + * Adafruit! + * + * + * BSD license (see license.txt) + */ + +#ifndef _ADAFRUIT_LSM6DSO32_H +#define _ADAFRUIT_LSM6DSO32_H + +#include "Adafruit_LSM6DS.h" +#include "Adafruit_LSM6DSOX.h" +#define LSM6DSO32_CHIP_ID 0x6C ///< LSM6DSO32 default device id from WHOAMI + +/** The accelerometer data range */ +typedef enum dso32_accel_range { + LSM6DSO32_ACCEL_RANGE_4_G, + LSM6DSO32_ACCEL_RANGE_32_G, + LSM6DSO32_ACCEL_RANGE_8_G, + LSM6DSO32_ACCEL_RANGE_16_G +} lsm6dso32_accel_range_t; + +/*! + * @brief Class that stores state and functions for interacting with + * the LSM6DSO32 I2C Digital Potentiometer + */ +class Adafruit_LSM6DSO32 : public Adafruit_LSM6DSOX { +public: + Adafruit_LSM6DSO32(); + + lsm6dso32_accel_range_t getAccelRange(void); + void setAccelRange(lsm6dso32_accel_range_t new_range); + void _read(void); + +private: + bool _init(int32_t sensor_id); +}; + +#endif diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSOX.cpp b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSOX.cpp new file mode 100644 index 0000000..f739609 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSOX.cpp @@ -0,0 +1,90 @@ + +/*! + * @file Adafruit_LSM6DSOX.cpp + * Adafruit LSM6DSOX 6-DoF Accelerometer and Gyroscope library + * + * Bryan Siepert for Adafruit Industries + * BSD (see license.txt) + */ + +#include "Arduino.h" +#include + +#include "Adafruit_LSM6DSOX.h" + +/*! + * @brief Instantiates a new LSM6DSOX class + */ +Adafruit_LSM6DSOX::Adafruit_LSM6DSOX(void) {} + +bool Adafruit_LSM6DSOX::_init(int32_t sensor_id) { + Adafruit_BusIO_Register chip_id = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_WHOAMI); + + // make sure we're talking to the right chip + if (chip_id.read() != LSM6DSOX_CHIP_ID) { + return false; + } + _sensorid_accel = sensor_id; + _sensorid_gyro = sensor_id + 1; + _sensorid_temp = sensor_id + 2; + + reset(); + + // Block Data Update + Adafruit_BusIO_Register ctrl3 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DSOX_CTRL3_C); + Adafruit_BusIO_RegisterBits bdu = Adafruit_BusIO_RegisterBits(&ctrl3, 1, 6); + bdu.write(true); + + // Disable I3C + Adafruit_BusIO_Register ctrl_9 = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DSOX_CTRL9_XL); + Adafruit_BusIO_RegisterBits i3c_disable_bit = + Adafruit_BusIO_RegisterBits(&ctrl_9, 1, 1); + + i3c_disable_bit.write(true); + + // call base class _init() + Adafruit_LSM6DS::_init(sensor_id); + + return true; +} + +/**************************************************************************/ +/*! + @brief Disables and enables the SPI master bus pulllups. + @param disable_pullups true to **disable** the I2C pullups, false to enable. +*/ +void Adafruit_LSM6DSOX::disableSPIMasterPullups(bool disable_pullups) { + + Adafruit_BusIO_Register pin_config = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DSOX_PIN_CTRL); + + Adafruit_BusIO_RegisterBits disable_ois_pu = + Adafruit_BusIO_RegisterBits(&pin_config, 1, 7); + + disable_ois_pu.write(disable_pullups); +} + +/**************************************************************************/ +/*! + @brief Enables and disables the I2C master bus pulllups. + @param enable_pullups true to enable the I2C pullups, false to disable. +*/ +void Adafruit_LSM6DSOX::enableI2CMasterPullups(bool enable_pullups) { + + Adafruit_BusIO_Register func_cfg_access = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DSOX_FUNC_CFG_ACCESS); + Adafruit_BusIO_RegisterBits master_cfg_enable_bit = + Adafruit_BusIO_RegisterBits(&func_cfg_access, 1, 6); + + Adafruit_BusIO_Register master_config = Adafruit_BusIO_Register( + i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DSOX_MASTER_CONFIG); + Adafruit_BusIO_RegisterBits i2c_master_pu_en = + Adafruit_BusIO_RegisterBits(&master_config, 1, 3); + + master_cfg_enable_bit.write(true); + i2c_master_pu_en.write(enable_pullups); + master_cfg_enable_bit.write(false); +} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSOX.h b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSOX.h new file mode 100644 index 0000000..d226dd7 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSOX.h @@ -0,0 +1,53 @@ +/*! + * @file Adafruit_LSM6DSOX.h + * + * I2C Driver for the Adafruit LSM6DSOX 6-DoF Accelerometer and Gyroscope + *library + * + * This is a library for the Adafruit LSM6DSOX breakout: + * https://www.adafruit.com/products/PID_HERE + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing products from + * Adafruit! + * + * + * BSD license (see license.txt) + */ + +#ifndef _ADAFRUIT_LSM6DSOX_H +#define _ADAFRUIT_LSM6DSOX_H + +#include "Adafruit_LSM6DS.h" + +#define LSM6DSOX_CHIP_ID 0x6C ///< LSM6DSOX default device id from WHOAMI + +#define LSM6DSOX_FUNC_CFG_ACCESS 0x1 ///< Enable embedded functions register +#define LSM6DSOX_PIN_CTRL 0x2 ///< Pin control register + +#define LSM6DSOX_INT1_CTRL 0x0D ///< Interrupt enable for data ready +#define LSM6DSOX_CTRL1_XL 0x10 ///< Main accelerometer config register +#define LSM6DSOX_CTRL2_G 0x11 ///< Main gyro config register +#define LSM6DSOX_CTRL3_C 0x12 ///< Main configuration register +#define LSM6DSOX_CTRL9_XL 0x18 ///< Includes i3c disable bit + +#define LSM6DSOX_MASTER_CONFIG 0x14 +///< I2C Master config; access must be enabled with bit SHUB_REG_ACCESS +///< is set to '1' in FUNC_CFG_ACCESS (01h). + +/*! + * @brief Class that stores state and functions for interacting with + * the LSM6DSOX I2C Digital Potentiometer + */ +class Adafruit_LSM6DSOX : public Adafruit_LSM6DS { +public: + Adafruit_LSM6DSOX(); + + void enableI2CMasterPullups(bool enable_pullups); + void disableSPIMasterPullups(bool disable_pullups); + +private: + bool _init(int32_t sensor_id); +}; + +#endif diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/README.md b/.pio/libdeps/teensy41/Adafruit LSM6DS/README.md new file mode 100644 index 0000000..30a6dfe --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/README.md @@ -0,0 +1,35 @@ +# Adafruit LSM6DS ![Build Status](https://github.com/adafruit/Adafruit_LSM6DS/workflows/Arduino%20Library%20CI/badge.svg) + +This is the Adafruit LSM6DS 6-DoF Accelerometer and Gyroscope Sensor Library for Arduino + +Tested and works great with the Adafruit LSM6DSOX Breakout Board +[](https://www.adafruit.com/products/4438) + + +This chip uses I2C to communicate, 2 pins are required to interface + +Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! + +# Dependencies +* [Adafruit_BusIO](https://github.com/adafruit/Adafruit_BusIO) +* [Adafruit_Sensor](https://github.com/adafruit/Adafruit_Sensor) + +# Contributing + +Contributions are welcome! Please read our [Code of Conduct](https://github.com/adafruit/Adafruit_LSM6DSOX/blob/master/CODE_OF_CONDUCT.md>) +before contributing to help this project stay welcoming. + +## Documentation and doxygen +Documentation is produced by doxygen. Contributions should include documentation for any new code added. + +Some examples of how to use doxygen can be found in these guide pages: + +https://learn.adafruit.com/the-well-automated-arduino-library/doxygen + +https://learn.adafruit.com/the-well-automated-arduino-library/doxygen-tips + +Written by Bryan Siepert for Adafruit Industries. +BSD license, check license.txt for more information +All text above must be included in any redistribution + +To install, use the Arduino Library Manager and search for "Adafruit LSM6DS" and install the library. diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/code-of-conduct.md b/.pio/libdeps/teensy41/Adafruit LSM6DS/code-of-conduct.md new file mode 100644 index 0000000..8ee6e44 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/code-of-conduct.md @@ -0,0 +1,127 @@ +# Adafruit Community Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and leaders pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level or type of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +We are committed to providing a friendly, safe and welcoming environment for +all. + +Examples of behavior that contributes to creating a positive environment +include: + +* Be kind and courteous to others +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Collaborating with other community members +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and sexual attention or advances +* The use of inappropriate images, including in a community member's avatar +* The use of inappropriate language, including in a community member's nickname +* Any spamming, flaming, baiting or other attention-stealing behavior +* Excessive or unwelcome helping; answering outside the scope of the question + asked +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate + +The goal of the standards and moderation guidelines outlined here is to build +and maintain a respectful community. We ask that you don’t just aim to be +"technically unimpeachable", but rather try to be your best self. + +We value many things beyond technical expertise, including collaboration and +supporting others within our community. Providing a positive experience for +other community members can have a much more significant impact than simply +providing the correct answer. + +## Our Responsibilities + +Project leaders are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project leaders have the right and responsibility to remove, edit, or +reject messages, comments, commits, code, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any community member for other behaviors that they deem +inappropriate, threatening, offensive, or harmful. + +## Moderation + +Instances of behaviors that violate the Adafruit Community Code of Conduct +may be reported by any member of the community. Community members are +encouraged to report these situations, including situations they witness +involving other community members. + +You may report in the following ways: + +In any situation, you may send an email to . + +On the Adafruit Discord, you may send an open message from any channel +to all Community Helpers by tagging @community helpers. You may also send an +open message from any channel, or a direct message to @kattni#1507, +@tannewt#4653, @Dan Halbert#1614, @cater#2442, @sommersoft#0222, or +@Andon#8175. + +Email and direct message reports will be kept confidential. + +In situations on Discord where the issue is particularly egregious, possibly +illegal, requires immediate action, or violates the Discord terms of service, +you should also report the message directly to Discord. + +These are the steps for upholding our community’s standards of conduct. + +1. Any member of the community may report any situation that violates the +Adafruit Community Code of Conduct. All reports will be reviewed and +investigated. +2. If the behavior is an egregious violation, the community member who +committed the violation may be banned immediately, without warning. +3. Otherwise, moderators will first respond to such behavior with a warning. +4. Moderators follow a soft "three strikes" policy - the community member may +be given another chance, if they are receptive to the warning and change their +behavior. +5. If the community member is unreceptive or unreasonable when warned by a +moderator, or the warning goes unheeded, they may be banned for a first or +second offense. Repeated offenses will result in the community member being +banned. + +## Scope + +This Code of Conduct and the enforcement policies listed above apply to all +Adafruit Community venues. This includes but is not limited to any community +spaces (both public and private), the entire Adafruit Discord server, and +Adafruit GitHub repositories. Examples of Adafruit Community spaces include +but are not limited to meet-ups, audio chats on the Adafruit Discord, or +interaction at a conference. + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. As a community +member, you are representing our community, and are expected to behave +accordingly. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 1.4, available at +, +and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html). + +For other projects adopting the Adafruit Community Code of +Conduct, please contact the maintainers of those projects for enforcement. +If you wish to use this code of conduct for your own project, consider +explicitly mentioning your moderation policy or making a copy with your +own moderation policy so as to avoid confusion. diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_ism330dhcx_test/adafruit_ism330dhcx_test.ino b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_ism330dhcx_test/adafruit_ism330dhcx_test.ino new file mode 100644 index 0000000..63db406 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_ism330dhcx_test/adafruit_ism330dhcx_test.ino @@ -0,0 +1,198 @@ +// Basic demo for accelerometer/gyro readings from Adafruit ISM330DHCX + +#include + +// For SPI mode, we need a CS pin +#define LSM_CS 10 +// For software-SPI mode we need SCK/MOSI/MISO pins +#define LSM_SCK 13 +#define LSM_MISO 12 +#define LSM_MOSI 11 + +Adafruit_ISM330DHCX ism330dhcx; +void setup(void) { + Serial.begin(115200); + while (!Serial) + delay(10); // will pause Zero, Leonardo, etc until serial console opens + + Serial.println("Adafruit ISM330DHCX test!"); + + if (!ism330dhcx.begin_I2C()) { + // if (!ism330dhcx.begin_SPI(LSM_CS)) { + // if (!ism330dhcx.begin_SPI(LSM_CS, LSM_SCK, LSM_MISO, LSM_MOSI)) { + Serial.println("Failed to find ISM330DHCX chip"); + while (1) { + delay(10); + } + } + + Serial.println("ISM330DHCX Found!"); + + // ism330dhcx.setAccelRange(LSM6DS_ACCEL_RANGE_2_G); + Serial.print("Accelerometer range set to: "); + switch (ism330dhcx.getAccelRange()) { + case LSM6DS_ACCEL_RANGE_2_G: + Serial.println("+-2G"); + break; + case LSM6DS_ACCEL_RANGE_4_G: + Serial.println("+-4G"); + break; + case LSM6DS_ACCEL_RANGE_8_G: + Serial.println("+-8G"); + break; + case LSM6DS_ACCEL_RANGE_16_G: + Serial.println("+-16G"); + break; + } + + // ism330dhcx.setGyroRange(LSM6DS_GYRO_RANGE_250_DPS); + Serial.print("Gyro range set to: "); + switch (ism330dhcx.getGyroRange()) { + case LSM6DS_GYRO_RANGE_125_DPS: + Serial.println("125 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_250_DPS: + Serial.println("250 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_500_DPS: + Serial.println("500 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_1000_DPS: + Serial.println("1000 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_2000_DPS: + Serial.println("2000 degrees/s"); + break; + case ISM330DHCX_GYRO_RANGE_4000_DPS: + Serial.println("4000 degrees/s"); + break; + } + + // ism330dhcx.setAccelDataRate(LSM6DS_RATE_12_5_HZ); + Serial.print("Accelerometer data rate set to: "); + switch (ism330dhcx.getAccelDataRate()) { + case LSM6DS_RATE_SHUTDOWN: + Serial.println("0 Hz"); + break; + case LSM6DS_RATE_12_5_HZ: + Serial.println("12.5 Hz"); + break; + case LSM6DS_RATE_26_HZ: + Serial.println("26 Hz"); + break; + case LSM6DS_RATE_52_HZ: + Serial.println("52 Hz"); + break; + case LSM6DS_RATE_104_HZ: + Serial.println("104 Hz"); + break; + case LSM6DS_RATE_208_HZ: + Serial.println("208 Hz"); + break; + case LSM6DS_RATE_416_HZ: + Serial.println("416 Hz"); + break; + case LSM6DS_RATE_833_HZ: + Serial.println("833 Hz"); + break; + case LSM6DS_RATE_1_66K_HZ: + Serial.println("1.66 KHz"); + break; + case LSM6DS_RATE_3_33K_HZ: + Serial.println("3.33 KHz"); + break; + case LSM6DS_RATE_6_66K_HZ: + Serial.println("6.66 KHz"); + break; + } + + // ism330dhcx.setGyroDataRate(LSM6DS_RATE_12_5_HZ); + Serial.print("Gyro data rate set to: "); + switch (ism330dhcx.getGyroDataRate()) { + case LSM6DS_RATE_SHUTDOWN: + Serial.println("0 Hz"); + break; + case LSM6DS_RATE_12_5_HZ: + Serial.println("12.5 Hz"); + break; + case LSM6DS_RATE_26_HZ: + Serial.println("26 Hz"); + break; + case LSM6DS_RATE_52_HZ: + Serial.println("52 Hz"); + break; + case LSM6DS_RATE_104_HZ: + Serial.println("104 Hz"); + break; + case LSM6DS_RATE_208_HZ: + Serial.println("208 Hz"); + break; + case LSM6DS_RATE_416_HZ: + Serial.println("416 Hz"); + break; + case LSM6DS_RATE_833_HZ: + Serial.println("833 Hz"); + break; + case LSM6DS_RATE_1_66K_HZ: + Serial.println("1.66 KHz"); + break; + case LSM6DS_RATE_3_33K_HZ: + Serial.println("3.33 KHz"); + break; + case LSM6DS_RATE_6_66K_HZ: + Serial.println("6.66 KHz"); + break; + } + + ism330dhcx.configInt1(false, false, true); // accelerometer DRDY on INT1 + ism330dhcx.configInt2(false, true, false); // gyro DRDY on INT2 +} + +void loop() { + // /* Get a new normalized sensor event */ + sensors_event_t accel; + sensors_event_t gyro; + sensors_event_t temp; + ism330dhcx.getEvent(&accel, &gyro, &temp); + + Serial.print("\t\tTemperature "); + Serial.print(temp.temperature); + Serial.println(" deg C"); + + /* Display the results (acceleration is measured in m/s^2) */ + Serial.print("\t\tAccel X: "); + Serial.print(accel.acceleration.x); + Serial.print(" \tY: "); + Serial.print(accel.acceleration.y); + Serial.print(" \tZ: "); + Serial.print(accel.acceleration.z); + Serial.println(" m/s^2 "); + + /* Display the results (rotation is measured in rad/s) */ + Serial.print("\t\tGyro X: "); + Serial.print(gyro.gyro.x); + Serial.print(" \tY: "); + Serial.print(gyro.gyro.y); + Serial.print(" \tZ: "); + Serial.print(gyro.gyro.z); + Serial.println(" radians/s "); + Serial.println(); + + delay(100); + + // // serial plotter friendly format + + // Serial.print(temp.temperature); + // Serial.print(","); + + // Serial.print(accel.acceleration.x); + // Serial.print(","); Serial.print(accel.acceleration.y); + // Serial.print(","); Serial.print(accel.acceleration.z); + // Serial.print(","); + + // Serial.print(gyro.gyro.x); + // Serial.print(","); Serial.print(gyro.gyro.y); + // Serial.print(","); Serial.print(gyro.gyro.z); + // Serial.println(); + // delayMicroseconds(10000); +} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds33_test/adafruit_lsm6ds33_test.ino b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds33_test/adafruit_lsm6ds33_test.ino new file mode 100644 index 0000000..b8ac3df --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds33_test/adafruit_lsm6ds33_test.ino @@ -0,0 +1,197 @@ +// Basic demo for accelerometer/gyro readings from Adafruit LSM6DS33 + +#include + +// For SPI mode, we need a CS pin +#define LSM_CS 10 +// For software-SPI mode we need SCK/MOSI/MISO pins +#define LSM_SCK 13 +#define LSM_MISO 12 +#define LSM_MOSI 11 + +Adafruit_LSM6DS33 lsm6ds33; +void setup(void) { + Serial.begin(115200); + while (!Serial) + delay(10); // will pause Zero, Leonardo, etc until serial console opens + + Serial.println("Adafruit LSM6DS33 test!"); + + if (!lsm6ds33.begin_I2C()) { + // if (!lsm6ds33.begin_SPI(LSM_CS)) { + // if (!lsm6ds33.begin_SPI(LSM_CS, LSM_SCK, LSM_MISO, LSM_MOSI)) { + Serial.println("Failed to find LSM6DS33 chip"); + while (1) { + delay(10); + } + } + + Serial.println("LSM6DS33 Found!"); + + // lsm6ds33.setAccelRange(LSM6DS_ACCEL_RANGE_2_G); + Serial.print("Accelerometer range set to: "); + switch (lsm6ds33.getAccelRange()) { + case LSM6DS_ACCEL_RANGE_2_G: + Serial.println("+-2G"); + break; + case LSM6DS_ACCEL_RANGE_4_G: + Serial.println("+-4G"); + break; + case LSM6DS_ACCEL_RANGE_8_G: + Serial.println("+-8G"); + break; + case LSM6DS_ACCEL_RANGE_16_G: + Serial.println("+-16G"); + break; + } + + // lsm6ds33.setGyroRange(LSM6DS_GYRO_RANGE_250_DPS); + Serial.print("Gyro range set to: "); + switch (lsm6ds33.getGyroRange()) { + case LSM6DS_GYRO_RANGE_125_DPS: + Serial.println("125 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_250_DPS: + Serial.println("250 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_500_DPS: + Serial.println("500 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_1000_DPS: + Serial.println("1000 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_2000_DPS: + Serial.println("2000 degrees/s"); + break; + case ISM330DHCX_GYRO_RANGE_4000_DPS: + break; // unsupported range for the DS33 + } + + // lsm6ds33.setAccelDataRate(LSM6DS_RATE_12_5_HZ); + Serial.print("Accelerometer data rate set to: "); + switch (lsm6ds33.getAccelDataRate()) { + case LSM6DS_RATE_SHUTDOWN: + Serial.println("0 Hz"); + break; + case LSM6DS_RATE_12_5_HZ: + Serial.println("12.5 Hz"); + break; + case LSM6DS_RATE_26_HZ: + Serial.println("26 Hz"); + break; + case LSM6DS_RATE_52_HZ: + Serial.println("52 Hz"); + break; + case LSM6DS_RATE_104_HZ: + Serial.println("104 Hz"); + break; + case LSM6DS_RATE_208_HZ: + Serial.println("208 Hz"); + break; + case LSM6DS_RATE_416_HZ: + Serial.println("416 Hz"); + break; + case LSM6DS_RATE_833_HZ: + Serial.println("833 Hz"); + break; + case LSM6DS_RATE_1_66K_HZ: + Serial.println("1.66 KHz"); + break; + case LSM6DS_RATE_3_33K_HZ: + Serial.println("3.33 KHz"); + break; + case LSM6DS_RATE_6_66K_HZ: + Serial.println("6.66 KHz"); + break; + } + + // lsm6ds33.setGyroDataRate(LSM6DS_RATE_12_5_HZ); + Serial.print("Gyro data rate set to: "); + switch (lsm6ds33.getGyroDataRate()) { + case LSM6DS_RATE_SHUTDOWN: + Serial.println("0 Hz"); + break; + case LSM6DS_RATE_12_5_HZ: + Serial.println("12.5 Hz"); + break; + case LSM6DS_RATE_26_HZ: + Serial.println("26 Hz"); + break; + case LSM6DS_RATE_52_HZ: + Serial.println("52 Hz"); + break; + case LSM6DS_RATE_104_HZ: + Serial.println("104 Hz"); + break; + case LSM6DS_RATE_208_HZ: + Serial.println("208 Hz"); + break; + case LSM6DS_RATE_416_HZ: + Serial.println("416 Hz"); + break; + case LSM6DS_RATE_833_HZ: + Serial.println("833 Hz"); + break; + case LSM6DS_RATE_1_66K_HZ: + Serial.println("1.66 KHz"); + break; + case LSM6DS_RATE_3_33K_HZ: + Serial.println("3.33 KHz"); + break; + case LSM6DS_RATE_6_66K_HZ: + Serial.println("6.66 KHz"); + break; + } + + lsm6ds33.configInt1(false, false, true); // accelerometer DRDY on INT1 + lsm6ds33.configInt2(false, true, false); // gyro DRDY on INT2 +} + +void loop() { + // /* Get a new normalized sensor event */ + sensors_event_t accel; + sensors_event_t gyro; + sensors_event_t temp; + lsm6ds33.getEvent(&accel, &gyro, &temp); + + Serial.print("\t\tTemperature "); + Serial.print(temp.temperature); + Serial.println(" deg C"); + + /* Display the results (acceleration is measured in m/s^2) */ + Serial.print("\t\tAccel X: "); + Serial.print(accel.acceleration.x); + Serial.print(" \tY: "); + Serial.print(accel.acceleration.y); + Serial.print(" \tZ: "); + Serial.print(accel.acceleration.z); + Serial.println(" m/s^2 "); + + /* Display the results (rotation is measured in rad/s) */ + Serial.print("\t\tGyro X: "); + Serial.print(gyro.gyro.x); + Serial.print(" \tY: "); + Serial.print(gyro.gyro.y); + Serial.print(" \tZ: "); + Serial.print(gyro.gyro.z); + Serial.println(" radians/s "); + Serial.println(); + + delay(100); + + // // serial plotter friendly format + + // Serial.print(temp.temperature); + // Serial.print(","); + + // Serial.print(accel.acceleration.x); + // Serial.print(","); Serial.print(accel.acceleration.y); + // Serial.print(","); Serial.print(accel.acceleration.z); + // Serial.print(","); + + // Serial.print(gyro.gyro.x); + // Serial.print(","); Serial.print(gyro.gyro.y); + // Serial.print(","); Serial.print(gyro.gyro.z); + // Serial.println(); + // delayMicroseconds(10000); +} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds3trc_test/adafruit_lsm6ds3trc_test.ino b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds3trc_test/adafruit_lsm6ds3trc_test.ino new file mode 100644 index 0000000..420ac97 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds3trc_test/adafruit_lsm6ds3trc_test.ino @@ -0,0 +1,198 @@ +// Basic demo for accelerometer/gyro readings from Adafruit LSM6DS3TR-C + +#include + +// For SPI mode, we need a CS pin +#define LSM_CS 10 +// For software-SPI mode we need SCK/MOSI/MISO pins +#define LSM_SCK 13 +#define LSM_MISO 12 +#define LSM_MOSI 11 + +Adafruit_LSM6DS3TRC lsm6ds3trc; + +void setup(void) { + Serial.begin(115200); + while (!Serial) + delay(10); // will pause Zero, Leonardo, etc until serial console opens + + Serial.println("Adafruit LSM6DS3TR-C test!"); + + if (!lsm6ds3trc.begin_I2C()) { + // if (!lsm6ds3trc.begin_SPI(LSM_CS)) { + // if (!lsm6ds3trc.begin_SPI(LSM_CS, LSM_SCK, LSM_MISO, LSM_MOSI)) { + Serial.println("Failed to find LSM6DS3TR-C chip"); + while (1) { + delay(10); + } + } + + Serial.println("LSM6DS3TR-C Found!"); + + // lsm6ds3trc.setAccelRange(LSM6DS_ACCEL_RANGE_2_G); + Serial.print("Accelerometer range set to: "); + switch (lsm6ds3trc.getAccelRange()) { + case LSM6DS_ACCEL_RANGE_2_G: + Serial.println("+-2G"); + break; + case LSM6DS_ACCEL_RANGE_4_G: + Serial.println("+-4G"); + break; + case LSM6DS_ACCEL_RANGE_8_G: + Serial.println("+-8G"); + break; + case LSM6DS_ACCEL_RANGE_16_G: + Serial.println("+-16G"); + break; + } + + // lsm6ds3trc.setGyroRange(LSM6DS_GYRO_RANGE_250_DPS); + Serial.print("Gyro range set to: "); + switch (lsm6ds3trc.getGyroRange()) { + case LSM6DS_GYRO_RANGE_125_DPS: + Serial.println("125 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_250_DPS: + Serial.println("250 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_500_DPS: + Serial.println("500 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_1000_DPS: + Serial.println("1000 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_2000_DPS: + Serial.println("2000 degrees/s"); + break; + case ISM330DHCX_GYRO_RANGE_4000_DPS: + break; // unsupported range for the DS33 + } + + // lsm6ds3trc.setAccelDataRate(LSM6DS_RATE_12_5_HZ); + Serial.print("Accelerometer data rate set to: "); + switch (lsm6ds3trc.getAccelDataRate()) { + case LSM6DS_RATE_SHUTDOWN: + Serial.println("0 Hz"); + break; + case LSM6DS_RATE_12_5_HZ: + Serial.println("12.5 Hz"); + break; + case LSM6DS_RATE_26_HZ: + Serial.println("26 Hz"); + break; + case LSM6DS_RATE_52_HZ: + Serial.println("52 Hz"); + break; + case LSM6DS_RATE_104_HZ: + Serial.println("104 Hz"); + break; + case LSM6DS_RATE_208_HZ: + Serial.println("208 Hz"); + break; + case LSM6DS_RATE_416_HZ: + Serial.println("416 Hz"); + break; + case LSM6DS_RATE_833_HZ: + Serial.println("833 Hz"); + break; + case LSM6DS_RATE_1_66K_HZ: + Serial.println("1.66 KHz"); + break; + case LSM6DS_RATE_3_33K_HZ: + Serial.println("3.33 KHz"); + break; + case LSM6DS_RATE_6_66K_HZ: + Serial.println("6.66 KHz"); + break; + } + + // lsm6ds3trc.setGyroDataRate(LSM6DS_RATE_12_5_HZ); + Serial.print("Gyro data rate set to: "); + switch (lsm6ds3trc.getGyroDataRate()) { + case LSM6DS_RATE_SHUTDOWN: + Serial.println("0 Hz"); + break; + case LSM6DS_RATE_12_5_HZ: + Serial.println("12.5 Hz"); + break; + case LSM6DS_RATE_26_HZ: + Serial.println("26 Hz"); + break; + case LSM6DS_RATE_52_HZ: + Serial.println("52 Hz"); + break; + case LSM6DS_RATE_104_HZ: + Serial.println("104 Hz"); + break; + case LSM6DS_RATE_208_HZ: + Serial.println("208 Hz"); + break; + case LSM6DS_RATE_416_HZ: + Serial.println("416 Hz"); + break; + case LSM6DS_RATE_833_HZ: + Serial.println("833 Hz"); + break; + case LSM6DS_RATE_1_66K_HZ: + Serial.println("1.66 KHz"); + break; + case LSM6DS_RATE_3_33K_HZ: + Serial.println("3.33 KHz"); + break; + case LSM6DS_RATE_6_66K_HZ: + Serial.println("6.66 KHz"); + break; + } + + lsm6ds3trc.configInt1(false, false, true); // accelerometer DRDY on INT1 + lsm6ds3trc.configInt2(false, true, false); // gyro DRDY on INT2 +} + +void loop() { + // Get a new normalized sensor event + sensors_event_t accel; + sensors_event_t gyro; + sensors_event_t temp; + lsm6ds3trc.getEvent(&accel, &gyro, &temp); + + Serial.print("\t\tTemperature "); + Serial.print(temp.temperature); + Serial.println(" deg C"); + + /* Display the results (acceleration is measured in m/s^2) */ + Serial.print("\t\tAccel X: "); + Serial.print(accel.acceleration.x); + Serial.print(" \tY: "); + Serial.print(accel.acceleration.y); + Serial.print(" \tZ: "); + Serial.print(accel.acceleration.z); + Serial.println(" m/s^2 "); + + /* Display the results (rotation is measured in rad/s) */ + Serial.print("\t\tGyro X: "); + Serial.print(gyro.gyro.x); + Serial.print(" \tY: "); + Serial.print(gyro.gyro.y); + Serial.print(" \tZ: "); + Serial.print(gyro.gyro.z); + Serial.println(" radians/s "); + Serial.println(); + + delay(100); + + // // serial plotter friendly format + + // Serial.print(temp.temperature); + // Serial.print(","); + + // Serial.print(accel.acceleration.x); + // Serial.print(","); Serial.print(accel.acceleration.y); + // Serial.print(","); Serial.print(accel.acceleration.z); + // Serial.print(","); + + // Serial.print(gyro.gyro.x); + // Serial.print(","); Serial.print(gyro.gyro.y); + // Serial.print(","); Serial.print(gyro.gyro.z); + // Serial.println(); + // delayMicroseconds(10000); +} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_pedometer/adafruit_lsm6ds_pedometer.ino b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_pedometer/adafruit_lsm6ds_pedometer.ino new file mode 100644 index 0000000..1cfc25e --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_pedometer/adafruit_lsm6ds_pedometer.ino @@ -0,0 +1,52 @@ +// Basic demo for accelerometer/gyro readings from Adafruit LSM6DS33 + +#include +#include + +Adafruit_LSM6DS33 lsm; // can use any LSM6DS/ISM330 family chip! +//Adafruit_LSM6DS3TRC lsm; // uncomment to use LSM6DS3TR-C + +// For SPI mode, we need a CS pin +#define LSM_CS 10 +// For software-SPI mode we need SCK/MOSI/MISO pins +#define LSM_SCK 13 +#define LSM_MISO 12 +#define LSM_MOSI 11 + + +void setup(void) { + Serial.begin(115200); + while (!Serial) + delay(10); // will pause Zero, Leonardo, etc until serial console opens + + Serial.println("Adafruit LSM6DS pedometer test!"); + + if (!lsm.begin_I2C()) { + // if (!lsm.begin_SPI(LSM_CS)) { + // if (!lsm.begin_SPI(LSM_CS, LSM_SCK, LSM_MISO, LSM_MOSI)) { + Serial.println("Failed to find LSM6DS chip"); + while (1) { + delay(10); + } + } + + Serial.println("LSM6DS Found!"); + + // Set to 2G range and 26 Hz update rate + lsm.setAccelRange(LSM6DS_ACCEL_RANGE_2_G); + lsm.setGyroRange(LSM6DS_GYRO_RANGE_250_DPS); + lsm.setAccelDataRate(LSM6DS_RATE_26_HZ); + lsm.setGyroDataRate(LSM6DS_RATE_26_HZ); + + // step detect output on INT1 + lsm.configInt1(false, false, false, true); + + // turn it on! + Serial.println("Enable ped"); + lsm.enablePedometer(true); +} + +void loop() { + Serial.print("Steps taken: "); Serial.println(lsm.readPedometer()); + delay(100); // can wait as long as you like! +} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_shake/adafruit_lsm6ds_shake.ino b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_shake/adafruit_lsm6ds_shake.ino new file mode 100644 index 0000000..58eaeaa --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_shake/adafruit_lsm6ds_shake.ino @@ -0,0 +1,44 @@ +// Basic demo for accelerometer/gyro readings from Adafruit LSM6DS33 + +#include +#include + +// For SPI mode, we need a CS pin +#define LSM_CS 10 +// For software-SPI mode we need SCK/MOSI/MISO pins +#define LSM_SCK 13 +#define LSM_MISO 12 +#define LSM_MOSI 11 + + +Adafruit_LSM6DS33 lsm6ds; // uncomment to use LSM6DS33 +//Adafruit_LSM6DS3TRC lsm6ds; // uncomment to use LSM6DS3TR-C + +void setup(void) { + Serial.begin(115200); + while (!Serial) + delay(10); // will pause Zero, Leonardo, etc until serial console opens + + Serial.println("Adafruit LSM6DS shake test!"); + + if (!lsm6ds.begin_I2C()) { + // if (!lsm6ds.begin_SPI(LSM_CS)) { + // if (!lsm6ds.begin_SPI(LSM_CS, LSM_SCK, LSM_MISO, LSM_MOSI)) { + Serial.println("Failed to find LSM6DS chip"); + while (1) { + delay(10); + } + } + + Serial.println("LSM6DS Found!"); + + // enable shake detection + lsm6ds.enableWakeup(true); +} + +void loop() { + // check for shake + if (lsm6ds.shake()) { + Serial.println("SHAKE!"); + } +} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_unifiedsensors/adafruit_lsm6ds_unifiedsensors.ino b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_unifiedsensors/adafruit_lsm6ds_unifiedsensors.ino new file mode 100644 index 0000000..cf0ea1b --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_unifiedsensors/adafruit_lsm6ds_unifiedsensors.ino @@ -0,0 +1,85 @@ +// Demo for getting individual unified sensor data from the LSM6DS series + +// Can change this to be LSM6DSOX or whatever ya like +#include +#include + +Adafruit_LSM6DS33 lsm6ds; // can use any LSM6DS/ISM330 family chip! +//Adafruit_LSM6DS3TRC lsm6ds; // uncomment to use LSM6DS3TR-C +Adafruit_Sensor *lsm_temp, *lsm_accel, *lsm_gyro; + +void setup(void) { + Serial.begin(115200); + while (!Serial) + delay(10); // will pause Zero, Leonardo, etc until serial console opens + + Serial.println("Adafruit LSM6DS test!"); + + if (!lsm6ds.begin_I2C()) { + Serial.println("Failed to find LSM6DS chip"); + while (1) { + delay(10); + } + } + + Serial.println("LSM6DS Found!"); + lsm_temp = lsm6ds.getTemperatureSensor(); + lsm_temp->printSensorDetails(); + + lsm_accel = lsm6ds.getAccelerometerSensor(); + lsm_accel->printSensorDetails(); + + lsm_gyro = lsm6ds.getGyroSensor(); + lsm_gyro->printSensorDetails(); +} + +void loop() { + // /* Get a new normalized sensor event */ + sensors_event_t accel; + sensors_event_t gyro; + sensors_event_t temp; + lsm_temp->getEvent(&temp); + lsm_accel->getEvent(&accel); + lsm_gyro->getEvent(&gyro); + + Serial.print("\t\tTemperature "); + Serial.print(temp.temperature); + Serial.println(" deg C"); + + /* Display the results (acceleration is measured in m/s^2) */ + Serial.print("\t\tAccel X: "); + Serial.print(accel.acceleration.x); + Serial.print(" \tY: "); + Serial.print(accel.acceleration.y); + Serial.print(" \tZ: "); + Serial.print(accel.acceleration.z); + Serial.println(" m/s^2 "); + + /* Display the results (rotation is measured in rad/s) */ + Serial.print("\t\tGyro X: "); + Serial.print(gyro.gyro.x); + Serial.print(" \tY: "); + Serial.print(gyro.gyro.y); + Serial.print(" \tZ: "); + Serial.print(gyro.gyro.z); + Serial.println(" radians/s "); + Serial.println(); + + delay(100); + + /* serial plotter friendly format + Serial.print(temp.temperature); + Serial.print(","); + + Serial.print(accel.acceleration.x); + Serial.print(","); Serial.print(accel.acceleration.y); + Serial.print(","); Serial.print(accel.acceleration.z); + Serial.print(","); + + Serial.print(gyro.gyro.x); + Serial.print(","); Serial.print(gyro.gyro.y); + Serial.print(","); Serial.print(gyro.gyro.z); + Serial.println(); + delay(10); + */ +} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6dso32_test/adafruit_lsm6dso32_test.ino b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6dso32_test/adafruit_lsm6dso32_test.ino new file mode 100644 index 0000000..17baedd --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6dso32_test/adafruit_lsm6dso32_test.ino @@ -0,0 +1,196 @@ +// Basic demo for accelerometer & gyro readings from Adafruit +// LSM6DSO32 sensor + +#include + +// For SPI mode, we need a CS pin +#define LSM_CS 10 +// For software-SPI mode we need SCK/MOSI/MISO pins +#define LSM_SCK 13 +#define LSM_MISO 12 +#define LSM_MOSI 11 + +Adafruit_LSM6DSO32 dso32; +void setup(void) { + Serial.begin(115200); + while (!Serial) + delay(10); // will pause Zero, Leonardo, etc until serial console opens + + Serial.println("Adafruit LSM6DSO32 test!"); + + if (!dso32.begin_I2C()) { + // if (!dso32.begin_SPI(LSM_CS)) { + // if (!dso32.begin_SPI(LSM_CS, LSM_SCK, LSM_MISO, LSM_MOSI)) { + // Serial.println("Failed to find LSM6DSO32 chip"); + while (1) { + delay(10); + } + } + + Serial.println("LSM6DSO32 Found!"); + + dso32.setAccelRange(LSM6DSO32_ACCEL_RANGE_8_G); + Serial.print("Accelerometer range set to: "); + switch (dso32.getAccelRange()) { + case LSM6DSO32_ACCEL_RANGE_4_G: + Serial.println("+-4G"); + break; + case LSM6DSO32_ACCEL_RANGE_8_G: + Serial.println("+-8G"); + break; + case LSM6DSO32_ACCEL_RANGE_16_G: + Serial.println("+-16G"); + break; + case LSM6DSO32_ACCEL_RANGE_32_G: + Serial.println("+-32G"); + break; + } + + // dso32.setGyroRange(LSM6DS_GYRO_RANGE_250_DPS ); + Serial.print("Gyro range set to: "); + switch (dso32.getGyroRange()) { + case LSM6DS_GYRO_RANGE_125_DPS: + Serial.println("125 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_250_DPS: + Serial.println("250 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_500_DPS: + Serial.println("500 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_1000_DPS: + Serial.println("1000 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_2000_DPS: + Serial.println("2000 degrees/s"); + break; + case ISM330DHCX_GYRO_RANGE_4000_DPS: + break; // unsupported range for the DSO32 + } + + // dso32.setAccelDataRate(LSM6DS_RATE_12_5_HZ); + Serial.print("Accelerometer data rate set to: "); + switch (dso32.getAccelDataRate()) { + case LSM6DS_RATE_SHUTDOWN: + Serial.println("0 Hz"); + break; + case LSM6DS_RATE_12_5_HZ: + Serial.println("12.5 Hz"); + break; + case LSM6DS_RATE_26_HZ: + Serial.println("26 Hz"); + break; + case LSM6DS_RATE_52_HZ: + Serial.println("52 Hz"); + break; + case LSM6DS_RATE_104_HZ: + Serial.println("104 Hz"); + break; + case LSM6DS_RATE_208_HZ: + Serial.println("208 Hz"); + break; + case LSM6DS_RATE_416_HZ: + Serial.println("416 Hz"); + break; + case LSM6DS_RATE_833_HZ: + Serial.println("833 Hz"); + break; + case LSM6DS_RATE_1_66K_HZ: + Serial.println("1.66 KHz"); + break; + case LSM6DS_RATE_3_33K_HZ: + Serial.println("3.33 KHz"); + break; + case LSM6DS_RATE_6_66K_HZ: + Serial.println("6.66 KHz"); + break; + } + + // dso32.setGyroDataRate(LSM6DS_RATE_12_5_HZ); + Serial.print("Gyro data rate set to: "); + switch (dso32.getGyroDataRate()) { + case LSM6DS_RATE_SHUTDOWN: + Serial.println("0 Hz"); + break; + case LSM6DS_RATE_12_5_HZ: + Serial.println("12.5 Hz"); + break; + case LSM6DS_RATE_26_HZ: + Serial.println("26 Hz"); + break; + case LSM6DS_RATE_52_HZ: + Serial.println("52 Hz"); + break; + case LSM6DS_RATE_104_HZ: + Serial.println("104 Hz"); + break; + case LSM6DS_RATE_208_HZ: + Serial.println("208 Hz"); + break; + case LSM6DS_RATE_416_HZ: + Serial.println("416 Hz"); + break; + case LSM6DS_RATE_833_HZ: + Serial.println("833 Hz"); + break; + case LSM6DS_RATE_1_66K_HZ: + Serial.println("1.66 KHz"); + break; + case LSM6DS_RATE_3_33K_HZ: + Serial.println("3.33 KHz"); + break; + case LSM6DS_RATE_6_66K_HZ: + Serial.println("6.66 KHz"); + break; + } +} + +void loop() { + + // /* Get a new normalized sensor event */ + sensors_event_t accel; + sensors_event_t gyro; + sensors_event_t temp; + dso32.getEvent(&accel, &gyro, &temp); + + Serial.print("\t\tTemperature "); + Serial.print(temp.temperature); + Serial.println(" deg C"); + + /* Display the results (acceleration is measured in m/s^2) */ + Serial.print("\t\tAccel X: "); + Serial.print(accel.acceleration.x); + Serial.print(" \tY: "); + Serial.print(accel.acceleration.y); + Serial.print(" \tZ: "); + Serial.print(accel.acceleration.z); + Serial.println(" m/s^2 "); + + /* Display the results (rotation is measured in rad/s) */ + Serial.print("\t\tGyro X: "); + Serial.print(gyro.gyro.x); + Serial.print(" \tY: "); + Serial.print(gyro.gyro.y); + Serial.print(" \tZ: "); + Serial.print(gyro.gyro.z); + Serial.println(" radians/s "); + Serial.println(); + + delay(100); + + // // serial plotter friendly format + + // Serial.print(temp.temperature); + // Serial.print(","); + + // Serial.print(accel.acceleration.x); + // Serial.print(","); Serial.print(accel.acceleration.y); + // Serial.print(","); Serial.print(accel.acceleration.z); + // Serial.print(","); + + // Serial.print(gyro.gyro.x); + // Serial.print(","); Serial.print(gyro.gyro.y); + // Serial.print(","); Serial.print(gyro.gyro.z); + // Serial.println(); + // delayMicroseconds(10000); +} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6dsox_test/adafruit_lsm6dsox_test.ino b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6dsox_test/adafruit_lsm6dsox_test.ino new file mode 100644 index 0000000..0dd1396 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6dsox_test/adafruit_lsm6dsox_test.ino @@ -0,0 +1,196 @@ +// Basic demo for accelerometer & gyro readings from Adafruit +// LSM6DSOX sensor + +#include + +// For SPI mode, we need a CS pin +#define LSM_CS 10 +// For software-SPI mode we need SCK/MOSI/MISO pins +#define LSM_SCK 13 +#define LSM_MISO 12 +#define LSM_MOSI 11 + +Adafruit_LSM6DSOX sox; +void setup(void) { + Serial.begin(115200); + while (!Serial) + delay(10); // will pause Zero, Leonardo, etc until serial console opens + + Serial.println("Adafruit LSM6DSOX test!"); + + if (!sox.begin_I2C()) { + // if (!sox.begin_SPI(LSM_CS)) { + // if (!sox.begin_SPI(LSM_CS, LSM_SCK, LSM_MISO, LSM_MOSI)) { + // Serial.println("Failed to find LSM6DSOX chip"); + while (1) { + delay(10); + } + } + + Serial.println("LSM6DSOX Found!"); + + // sox.setAccelRange(LSM6DS_ACCEL_RANGE_2_G); + Serial.print("Accelerometer range set to: "); + switch (sox.getAccelRange()) { + case LSM6DS_ACCEL_RANGE_2_G: + Serial.println("+-2G"); + break; + case LSM6DS_ACCEL_RANGE_4_G: + Serial.println("+-4G"); + break; + case LSM6DS_ACCEL_RANGE_8_G: + Serial.println("+-8G"); + break; + case LSM6DS_ACCEL_RANGE_16_G: + Serial.println("+-16G"); + break; + } + + // sox.setGyroRange(LSM6DS_GYRO_RANGE_250_DPS ); + Serial.print("Gyro range set to: "); + switch (sox.getGyroRange()) { + case LSM6DS_GYRO_RANGE_125_DPS: + Serial.println("125 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_250_DPS: + Serial.println("250 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_500_DPS: + Serial.println("500 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_1000_DPS: + Serial.println("1000 degrees/s"); + break; + case LSM6DS_GYRO_RANGE_2000_DPS: + Serial.println("2000 degrees/s"); + break; + case ISM330DHCX_GYRO_RANGE_4000_DPS: + break; // unsupported range for the DSOX + } + + // sox.setAccelDataRate(LSM6DS_RATE_12_5_HZ); + Serial.print("Accelerometer data rate set to: "); + switch (sox.getAccelDataRate()) { + case LSM6DS_RATE_SHUTDOWN: + Serial.println("0 Hz"); + break; + case LSM6DS_RATE_12_5_HZ: + Serial.println("12.5 Hz"); + break; + case LSM6DS_RATE_26_HZ: + Serial.println("26 Hz"); + break; + case LSM6DS_RATE_52_HZ: + Serial.println("52 Hz"); + break; + case LSM6DS_RATE_104_HZ: + Serial.println("104 Hz"); + break; + case LSM6DS_RATE_208_HZ: + Serial.println("208 Hz"); + break; + case LSM6DS_RATE_416_HZ: + Serial.println("416 Hz"); + break; + case LSM6DS_RATE_833_HZ: + Serial.println("833 Hz"); + break; + case LSM6DS_RATE_1_66K_HZ: + Serial.println("1.66 KHz"); + break; + case LSM6DS_RATE_3_33K_HZ: + Serial.println("3.33 KHz"); + break; + case LSM6DS_RATE_6_66K_HZ: + Serial.println("6.66 KHz"); + break; + } + + // sox.setGyroDataRate(LSM6DS_RATE_12_5_HZ); + Serial.print("Gyro data rate set to: "); + switch (sox.getGyroDataRate()) { + case LSM6DS_RATE_SHUTDOWN: + Serial.println("0 Hz"); + break; + case LSM6DS_RATE_12_5_HZ: + Serial.println("12.5 Hz"); + break; + case LSM6DS_RATE_26_HZ: + Serial.println("26 Hz"); + break; + case LSM6DS_RATE_52_HZ: + Serial.println("52 Hz"); + break; + case LSM6DS_RATE_104_HZ: + Serial.println("104 Hz"); + break; + case LSM6DS_RATE_208_HZ: + Serial.println("208 Hz"); + break; + case LSM6DS_RATE_416_HZ: + Serial.println("416 Hz"); + break; + case LSM6DS_RATE_833_HZ: + Serial.println("833 Hz"); + break; + case LSM6DS_RATE_1_66K_HZ: + Serial.println("1.66 KHz"); + break; + case LSM6DS_RATE_3_33K_HZ: + Serial.println("3.33 KHz"); + break; + case LSM6DS_RATE_6_66K_HZ: + Serial.println("6.66 KHz"); + break; + } +} + +void loop() { + + // /* Get a new normalized sensor event */ + sensors_event_t accel; + sensors_event_t gyro; + sensors_event_t temp; + sox.getEvent(&accel, &gyro, &temp); + + Serial.print("\t\tTemperature "); + Serial.print(temp.temperature); + Serial.println(" deg C"); + + /* Display the results (acceleration is measured in m/s^2) */ + Serial.print("\t\tAccel X: "); + Serial.print(accel.acceleration.x); + Serial.print(" \tY: "); + Serial.print(accel.acceleration.y); + Serial.print(" \tZ: "); + Serial.print(accel.acceleration.z); + Serial.println(" m/s^2 "); + + /* Display the results (rotation is measured in rad/s) */ + Serial.print("\t\tGyro X: "); + Serial.print(gyro.gyro.x); + Serial.print(" \tY: "); + Serial.print(gyro.gyro.y); + Serial.print(" \tZ: "); + Serial.print(gyro.gyro.z); + Serial.println(" radians/s "); + Serial.println(); + + delay(100); + + // // serial plotter friendly format + + // Serial.print(temp.temperature); + // Serial.print(","); + + // Serial.print(accel.acceleration.x); + // Serial.print(","); Serial.print(accel.acceleration.y); + // Serial.print(","); Serial.print(accel.acceleration.z); + // Serial.print(","); + + // Serial.print(gyro.gyro.x); + // Serial.print(","); Serial.print(gyro.gyro.y); + // Serial.print(","); Serial.print(gyro.gyro.z); + // Serial.println(); + // delayMicroseconds(10000); +} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/library.properties b/.pio/libdeps/teensy41/Adafruit LSM6DS/library.properties new file mode 100644 index 0000000..1706aff --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/library.properties @@ -0,0 +1,10 @@ +name=Adafruit LSM6DS +version=4.7.0 +author=Adafruit +maintainer=Adafruit +sentence=Arduino library for the LSM6DS sensors in the Adafruit shop +paragraph=Arduino library for the LSM6DS sensors in the Adafruit shop +category=Sensors +url=https://github.com/adafruit/Adafruit_LSM6DS +architectures=* +depends=Adafruit Unified Sensor, Adafruit BusIO diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/license.txt b/.pio/libdeps/teensy41/Adafruit LSM6DS/license.txt new file mode 100644 index 0000000..bc90c68 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit LSM6DS/license.txt @@ -0,0 +1,26 @@ +Software License Agreement (BSD License) + +Copyright (c) 2019 Bryan Siepert for Adafruit Industries +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +3. Neither the name of the copyright holders nor the +names of its contributors may be used to endorse or promote products +derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.pio/libdeps/teensy41/Adafruit Unified Sensor/.gitignore b/.pio/libdeps/teensy41/Adafruit Unified Sensor/.gitignore new file mode 100644 index 0000000..d04184a --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit Unified Sensor/.gitignore @@ -0,0 +1,108 @@ +# +# NOTE! Don't add files that are generated in specific +# subdirectories here. Add them in the ".gitignore" file +# in that subdirectory instead. +# +# NOTE! Please use 'git ls-files -i --exclude-standard' +# command after changing this file, to see if there are +# any tracked files which get ignored after the change. +# +# Normal rules +# +.* +*.o +*.o.* +*.a +*.s +*.ko +*.so +*.so.dbg +*.mod.c +*.i +*.lst +*.symtypes +*.order +modules.builtin +*.elf +*.bin +*.gz +*.bz2 +*.lzma +*.patch +*.gcno + +# +# Top-level generic files +# +/tags +/TAGS +/linux +/vmlinux +/vmlinuz +/System.map +/Module.markers +/Module.symvers + +# +# git files that we don't want to ignore even it they are dot-files +# +!.gitignore +!.mailmap + +# +# Generated include files +# +include/config +include/linux/version.h +include/generated + +# stgit generated dirs +patches-* + +# quilt's files +patches +series + +# cscope files +cscope.* +ncscope.* + +# gnu global files +GPATH +GRTAGS +GSYMS +GTAGS + +# QT-Creator files +Makefile.am.user +*.config +*.creator +*.creator.user +*.files +*.includes + +*.orig +*~ +\#*# +*.lo +*.la +Makefile +Makefile.in +aclocal.m4 +autoconfig.h +autoconfig.h.in +autom4te.cache/ +build-aux/ +config.log +config.status +configure +libtool +libupnp.pc +m4/libtool.m4 +m4/ltoptions.m4 +m4/ltsugar.m4 +m4/ltversion.m4 +m4/lt~obsolete.m4 +stamp-h1 +docs/doxygen + diff --git a/.pio/libdeps/teensy41/Adafruit Unified Sensor/Adafruit_Sensor.cpp b/.pio/libdeps/teensy41/Adafruit Unified Sensor/Adafruit_Sensor.cpp new file mode 100644 index 0000000..b854a5a --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit Unified Sensor/Adafruit_Sensor.cpp @@ -0,0 +1,120 @@ +#include "Adafruit_Sensor.h" + +/**************************************************************************/ +/*! + @brief Prints sensor information to serial console +*/ +/**************************************************************************/ +void Adafruit_Sensor::printSensorDetails(void) { + sensor_t sensor; + getSensor(&sensor); + Serial.println(F("------------------------------------")); + Serial.print(F("Sensor: ")); + Serial.println(sensor.name); + Serial.print(F("Type: ")); + switch ((sensors_type_t)sensor.type) { + case SENSOR_TYPE_ACCELEROMETER: + Serial.print(F("Acceleration (m/s2)")); + break; + case SENSOR_TYPE_MAGNETIC_FIELD: + Serial.print(F("Magnetic (uT)")); + break; + case SENSOR_TYPE_ORIENTATION: + Serial.print(F("Orientation (degrees)")); + break; + case SENSOR_TYPE_GYROSCOPE: + Serial.print(F("Gyroscopic (rad/s)")); + break; + case SENSOR_TYPE_LIGHT: + Serial.print(F("Light (lux)")); + break; + case SENSOR_TYPE_PRESSURE: + Serial.print(F("Pressure (hPa)")); + break; + case SENSOR_TYPE_PROXIMITY: + Serial.print(F("Distance (cm)")); + break; + case SENSOR_TYPE_GRAVITY: + Serial.print(F("Gravity (m/s2)")); + break; + case SENSOR_TYPE_LINEAR_ACCELERATION: + Serial.print(F("Linear Acceleration (m/s2)")); + break; + case SENSOR_TYPE_ROTATION_VECTOR: + Serial.print(F("Rotation vector")); + break; + case SENSOR_TYPE_RELATIVE_HUMIDITY: + Serial.print(F("Relative Humidity (%)")); + break; + case SENSOR_TYPE_AMBIENT_TEMPERATURE: + Serial.print(F("Ambient Temp (C)")); + break; + case SENSOR_TYPE_OBJECT_TEMPERATURE: + Serial.print(F("Object Temp (C)")); + break; + case SENSOR_TYPE_VOLTAGE: + Serial.print(F("Voltage (V)")); + break; + case SENSOR_TYPE_CURRENT: + Serial.print(F("Current (mA)")); + break; + case SENSOR_TYPE_COLOR: + Serial.print(F("Color (RGBA)")); + break; + case SENSOR_TYPE_TVOC: + Serial.print(F("Total Volatile Organic Compounds (ppb)")); + break; + case SENSOR_TYPE_VOC_INDEX: + Serial.print(F("Volatile Organic Compounds (Index)")); + break; + case SENSOR_TYPE_NOX_INDEX: + Serial.print(F("Nitrogen Oxides (Index)")); + break; + case SENSOR_TYPE_CO2: + Serial.print(F("Carbon Dioxide (ppm)")); + break; + case SENSOR_TYPE_ECO2: + Serial.print(F("Equivalent/estimated CO2 (ppm)")); + break; + case SENSOR_TYPE_PM10_STD: + Serial.print(F("Standard Particulate Matter 1.0 (ppm)")); + break; + case SENSOR_TYPE_PM25_STD: + Serial.print(F("Standard Particulate Matter 2.5 (ppm)")); + break; + case SENSOR_TYPE_PM100_STD: + Serial.print(F("Standard Particulate Matter 10.0 (ppm)")); + break; + case SENSOR_TYPE_PM10_ENV: + Serial.print(F("Environmental Particulate Matter 1.0 (ppm)")); + break; + case SENSOR_TYPE_PM25_ENV: + Serial.print(F("Environmental Particulate Matter 2.5 (ppm)")); + break; + case SENSOR_TYPE_PM100_ENV: + Serial.print(F("Environmental Particulate Matter 10.0 (ppm)")); + break; + case SENSOR_TYPE_GAS_RESISTANCE: + Serial.print(F("Gas Resistance (ohms)")); + break; + case SENSOR_TYPE_UNITLESS_PERCENT: + Serial.print(F("Unitless Percent (%)")); + break; + case SENSOR_TYPE_ALTITUDE: + Serial.print(F("Altitude (m)")); + break; + } + + Serial.println(); + Serial.print(F("Driver Ver: ")); + Serial.println(sensor.version); + Serial.print(F("Unique ID: ")); + Serial.println(sensor.sensor_id); + Serial.print(F("Min Value: ")); + Serial.println(sensor.min_value); + Serial.print(F("Max Value: ")); + Serial.println(sensor.max_value); + Serial.print(F("Resolution: ")); + Serial.println(sensor.resolution); + Serial.println(F("------------------------------------\n")); +} diff --git a/.pio/libdeps/teensy41/Adafruit Unified Sensor/Adafruit_Sensor.h b/.pio/libdeps/teensy41/Adafruit Unified Sensor/Adafruit_Sensor.h new file mode 100644 index 0000000..8c6a07d --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit Unified Sensor/Adafruit_Sensor.h @@ -0,0 +1,224 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software< /span> + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* Update by K. Townsend (Adafruit Industries) for lighter typedefs, and + * extended sensor support to include color, voltage and current */ + +#ifndef _ADAFRUIT_SENSOR_H +#define _ADAFRUIT_SENSOR_H + +#ifndef ARDUINO +#include +#elif ARDUINO >= 100 +#include "Arduino.h" +#include "Print.h" +#else +#include "WProgram.h" +#endif + +/* Constants */ +#define SENSORS_GRAVITY_EARTH (9.80665F) /**< Earth's gravity in m/s^2 */ +#define SENSORS_GRAVITY_MOON (1.6F) /**< The moon's gravity in m/s^2 */ +#define SENSORS_GRAVITY_SUN (275.0F) /**< The sun's gravity in m/s^2 */ +#define SENSORS_GRAVITY_STANDARD (SENSORS_GRAVITY_EARTH) +#define SENSORS_MAGFIELD_EARTH_MAX \ + (60.0F) /**< Maximum magnetic field on Earth's surface */ +#define SENSORS_MAGFIELD_EARTH_MIN \ + (30.0F) /**< Minimum magnetic field on Earth's surface */ +#define SENSORS_PRESSURE_SEALEVELHPA \ + (1013.25F) /**< Average sea level pressure is 1013.25 hPa */ +#define SENSORS_DPS_TO_RADS \ + (0.017453293F) /**< Degrees/s to rad/s multiplier \ + */ +#define SENSORS_RADS_TO_DPS \ + (57.29577793F) /**< Rad/s to degrees/s multiplier */ +#define SENSORS_GAUSS_TO_MICROTESLA \ + (100) /**< Gauss to micro-Tesla multiplier */ + +/** Sensor types */ +typedef enum { + SENSOR_TYPE_ACCELEROMETER = (1), /**< Gravity + linear acceleration */ + SENSOR_TYPE_MAGNETIC_FIELD = (2), + SENSOR_TYPE_ORIENTATION = (3), + SENSOR_TYPE_GYROSCOPE = (4), + SENSOR_TYPE_LIGHT = (5), + SENSOR_TYPE_PRESSURE = (6), + SENSOR_TYPE_PROXIMITY = (8), + SENSOR_TYPE_GRAVITY = (9), + SENSOR_TYPE_LINEAR_ACCELERATION = + (10), /**< Acceleration not including gravity */ + SENSOR_TYPE_ROTATION_VECTOR = (11), + SENSOR_TYPE_RELATIVE_HUMIDITY = (12), + SENSOR_TYPE_AMBIENT_TEMPERATURE = (13), + SENSOR_TYPE_OBJECT_TEMPERATURE = (14), + SENSOR_TYPE_VOLTAGE = (15), + SENSOR_TYPE_CURRENT = (16), + SENSOR_TYPE_COLOR = (17), + SENSOR_TYPE_TVOC = (18), + SENSOR_TYPE_VOC_INDEX = (19), + SENSOR_TYPE_NOX_INDEX = (20), + SENSOR_TYPE_CO2 = (21), + SENSOR_TYPE_ECO2 = (22), + SENSOR_TYPE_PM10_STD = (23), + SENSOR_TYPE_PM25_STD = (24), + SENSOR_TYPE_PM100_STD = (25), + SENSOR_TYPE_PM10_ENV = (26), + SENSOR_TYPE_PM25_ENV = (27), + SENSOR_TYPE_PM100_ENV = (28), + SENSOR_TYPE_GAS_RESISTANCE = (29), + SENSOR_TYPE_UNITLESS_PERCENT = (30), + SENSOR_TYPE_ALTITUDE = (31) +} sensors_type_t; + +/** struct sensors_vec_s is used to return a vector in a common format. */ +typedef struct { + union { + float v[3]; ///< 3D vector elements + struct { + float x; ///< X component of vector + float y; ///< Y component of vector + float z; ///< Z component of vector + }; ///< Struct for holding XYZ component + /* Orientation sensors */ + struct { + float roll; /**< Rotation around the longitudinal axis (the plane body, 'X + axis'). Roll is positive and increasing when moving + downward. -90 degrees <= roll <= 90 degrees */ + float pitch; /**< Rotation around the lateral axis (the wing span, 'Y + axis'). Pitch is positive and increasing when moving + upwards. -180 degrees <= pitch <= 180 degrees) */ + float heading; /**< Angle between the longitudinal axis (the plane body) + and magnetic north, measured clockwise when viewing from + the top of the device. 0-359 degrees */ + }; ///< Struct for holding roll/pitch/heading + }; ///< Union that can hold 3D vector array, XYZ components or + ///< roll/pitch/heading + int8_t status; ///< Status byte + uint8_t reserved[3]; ///< Reserved +} sensors_vec_t; + +/** struct sensors_color_s is used to return color data in a common format. */ +typedef struct { + union { + float c[3]; ///< Raw 3-element data + /* RGB color space */ + struct { + float r; /**< Red component */ + float g; /**< Green component */ + float b; /**< Blue component */ + }; ///< RGB data in floating point notation + }; ///< Union of various ways to describe RGB colorspace + uint32_t rgba; /**< 24-bit RGBA value */ +} sensors_color_t; + +/* Sensor event (36 bytes) */ +/** struct sensor_event_s is used to provide a single sensor event in a common + * format. */ +typedef struct { + int32_t version; /**< must be sizeof(struct sensors_event_t) */ + int32_t sensor_id; /**< unique sensor identifier */ + int32_t type; /**< sensor type */ + int32_t reserved0; /**< reserved */ + int32_t timestamp; /**< time is in milliseconds */ + union { + float data[4]; ///< Raw data */ + sensors_vec_t acceleration; /**< acceleration values are in meter per second + per second (m/s^2) */ + sensors_vec_t + magnetic; /**< magnetic vector values are in micro-Tesla (uT) */ + sensors_vec_t orientation; /**< orientation values are in degrees */ + sensors_vec_t gyro; /**< gyroscope values are in rad/s */ + float temperature; /**< temperature is in degrees centigrade (Celsius) */ + float distance; /**< distance in centimeters */ + float light; /**< light in SI lux units */ + float pressure; /**< pressure in hectopascal (hPa) */ + float relative_humidity; /**< relative humidity in percent */ + float current; /**< current in milliamps (mA) */ + float voltage; /**< voltage in volts (V) */ + float tvoc; /**< Total Volatile Organic Compounds, in ppb */ + float voc_index; /**< VOC (Volatile Organic Compound) index where 100 is + normal (unitless) */ + float nox_index; /**< NOx (Nitrogen Oxides) index where 100 is normal + (unitless) */ + float CO2; /**< Measured CO2 in parts per million (ppm) */ + float eCO2; /**< equivalent/estimated CO2 in parts per million (ppm + estimated from some other measurement) */ + float pm10_std; /**< Standard Particulate Matter <=1.0 in parts per million + (ppm) */ + float pm25_std; /**< Standard Particulate Matter <=2.5 in parts per million + (ppm) */ + float pm100_std; /**< Standard Particulate Matter <=10.0 in parts per + million (ppm) */ + float pm10_env; /**< Environmental Particulate Matter <=1.0 in parts per + million (ppm) */ + float pm25_env; /**< Environmental Particulate Matter <=2.5 in parts per + million (ppm) */ + float pm100_env; /**< Environmental Particulate Matter <=10.0 in parts per + million (ppm) */ + float gas_resistance; /**< Proportional to the amount of VOC particles in + the air (Ohms) */ + float unitless_percent; /** +#include +#include + +/* Assign a unique ID to this sensor at the same time */ +/* Uncomment following line for default Wire bus */ +Adafruit_ADXL343 accel = Adafruit_ADXL343(12345); + +/* NeoTrellis M4, etc. */ +/* Uncomment following line for Wire1 bus */ +//Adafruit_ADXL343 accel = Adafruit_ADXL343(12345, &Wire1); + +void displaySensorDetails(void) +{ + sensor_t sensor; + accel.getSensor(&sensor); + Serial.println("------------------------------------"); + Serial.print ("Sensor: "); Serial.println(sensor.name); + Serial.print ("Driver Ver: "); Serial.println(sensor.version); + Serial.print ("Unique ID: "); Serial.println(sensor.sensor_id); + Serial.print ("Max Value: "); Serial.print(sensor.max_value); Serial.println(" m/s^2"); + Serial.print ("Min Value: "); Serial.print(sensor.min_value); Serial.println(" m/s^2"); + Serial.print ("Resolution: "); Serial.print(sensor.resolution); Serial.println(" m/s^2"); + Serial.println("------------------------------------"); + Serial.println(""); + delay(500); +} + +void displayDataRate(void) +{ + Serial.print ("Data Rate: "); + + switch(accel.getDataRate()) + { + case ADXL343_DATARATE_3200_HZ: + Serial.print ("3200 "); + break; + case ADXL343_DATARATE_1600_HZ: + Serial.print ("1600 "); + break; + case ADXL343_DATARATE_800_HZ: + Serial.print ("800 "); + break; + case ADXL343_DATARATE_400_HZ: + Serial.print ("400 "); + break; + case ADXL343_DATARATE_200_HZ: + Serial.print ("200 "); + break; + case ADXL343_DATARATE_100_HZ: + Serial.print ("100 "); + break; + case ADXL343_DATARATE_50_HZ: + Serial.print ("50 "); + break; + case ADXL343_DATARATE_25_HZ: + Serial.print ("25 "); + break; + case ADXL343_DATARATE_12_5_HZ: + Serial.print ("12.5 "); + break; + case ADXL343_DATARATE_6_25HZ: + Serial.print ("6.25 "); + break; + case ADXL343_DATARATE_3_13_HZ: + Serial.print ("3.13 "); + break; + case ADXL343_DATARATE_1_56_HZ: + Serial.print ("1.56 "); + break; + case ADXL343_DATARATE_0_78_HZ: + Serial.print ("0.78 "); + break; + case ADXL343_DATARATE_0_39_HZ: + Serial.print ("0.39 "); + break; + case ADXL343_DATARATE_0_20_HZ: + Serial.print ("0.20 "); + break; + case ADXL343_DATARATE_0_10_HZ: + Serial.print ("0.10 "); + break; + default: + Serial.print ("???? "); + break; + } + Serial.println(" Hz"); +} + +void displayRange(void) +{ + Serial.print ("Range: +/- "); + + switch(accel.getRange()) + { + case ADXL343_RANGE_16_G: + Serial.print ("16 "); + break; + case ADXL343_RANGE_8_G: + Serial.print ("8 "); + break; + case ADXL343_RANGE_4_G: + Serial.print ("4 "); + break; + case ADXL343_RANGE_2_G: + Serial.print ("2 "); + break; + default: + Serial.print ("?? "); + break; + } + Serial.println(" g"); +} + +void setup(void) +{ + Serial.begin(9600); + while (!Serial); + Serial.println("Accelerometer Test"); Serial.println(""); + + /* Initialise the sensor */ + if(!accel.begin()) + { + /* There was a problem detecting the ADXL343 ... check your connections */ + Serial.println("Ooops, no ADXL343 detected ... Check your wiring!"); + while(1); + } + + /* Set the range to whatever is appropriate for your project */ + accel.setRange(ADXL343_RANGE_16_G); + // accel.setRange(ADXL343_RANGE_8_G); + // accel.setRange(ADXL343_RANGE_4_G); + // accel.setRange(ADXL343_RANGE_2_G); + + /* Display some basic information on this sensor */ + displaySensorDetails(); + displayDataRate(); + displayRange(); + Serial.println(""); +} + +void loop(void) +{ + /* Get a new sensor event */ + sensors_event_t event; + accel.getEvent(&event); + + /* Display the results (acceleration is measured in m/s^2) */ + Serial.print("X: "); Serial.print(event.acceleration.x); Serial.print(" "); + Serial.print("Y: "); Serial.print(event.acceleration.y); Serial.print(" "); + Serial.print("Z: "); Serial.print(event.acceleration.z); Serial.print(" ");Serial.println("m/s^2 "); + delay(500); +} diff --git a/.pio/libdeps/teensy41/Adafruit Unified Sensor/library.properties b/.pio/libdeps/teensy41/Adafruit Unified Sensor/library.properties new file mode 100644 index 0000000..96a6670 --- /dev/null +++ b/.pio/libdeps/teensy41/Adafruit Unified Sensor/library.properties @@ -0,0 +1,11 @@ +name=Adafruit Unified Sensor +version=1.1.13 +author=Adafruit +maintainer=Adafruit +sentence=Required for all Adafruit Unified Sensor based libraries. +paragraph=A unified sensor abstraction layer used by many Adafruit sensor libraries. +category=Sensors +url=https://github.com/adafruit/Adafruit_Sensor +architectures=* +includes=Adafruit_Sensor.h + diff --git a/.pio/libdeps/teensy41/integrity.dat b/.pio/libdeps/teensy41/integrity.dat new file mode 100644 index 0000000..0389e63 --- /dev/null +++ b/.pio/libdeps/teensy41/integrity.dat @@ -0,0 +1 @@ +adafruit/Adafruit LSM6DS@^4.7.0 \ No newline at end of file diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 46cf7f4..ea991f3 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -1,19 +1,253 @@ +// +// !!! WARNING !!! AUTO-GENERATED FILE! +// PLEASE DO NOT MODIFY IT AND USE "platformio.ini": +// https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags +// { "configurations": [ { - "name": "Win32", + "name": "PlatformIO", "includePath": [ - "${workspaceFolder}/**" + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/include", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/src", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit LSM6DS", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/cores/teensy4", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit BusIO", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit Unified Sensor", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPI", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ADC", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AccelStepper/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_NeoPixel", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_STMPE610", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_VS1053", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AltSoftSerial", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Artnet", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce2/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CapacitiveSensor", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CryptoAccel/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DS1307RTC", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DmxSimple", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DogLcd", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EEPROM", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransfer/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransferI2C/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Entropy", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ethernet/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FNET/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastCRC", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastLED/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN_T4", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexIO_t4/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexiTimer2", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqCount", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasure", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasureMulti", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FrequencyTimer2", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9341_t3", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9488_t3/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/IRremote/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Keypad/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedControl/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedDisplay", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystal/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystalFast", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LittleFS/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LowPower", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MFRC522/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MIDI/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Metro", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MsTimer2", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NativeEthernet/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OSC", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OctoWS2811", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OneWire", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PWMServo", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ping", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PulsePosition", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/QuadEncoder", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RA8875/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RadioHead", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ResponsiveAnalogRead/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SD/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPIFlash", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ST7735_t3/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SdFat/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SerialFlash", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Servo", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ShiftPWM", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Snooze/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftPWM", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftwareSerial", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TFT_ILI9163C", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Talkie", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TeensyThreads", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Time", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimeAlarms", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerOne", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerThree", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TinyGPS", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Tlc5940", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TouchScreen", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/UTFT", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/VirtualWire", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/WS2812Serial", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XBee", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XPT2046_Touchscreen", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/i2c_t3", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ks0108", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ssd1351", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/x10", + "" ], + "browse": { + "limitSymbolsToIncludedHeaders": true, + "path": [ + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/include", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/src", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit LSM6DS", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/cores/teensy4", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit BusIO", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit Unified Sensor", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPI", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ADC", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AccelStepper/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_NeoPixel", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_STMPE610", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_VS1053", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AltSoftSerial", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Artnet", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce2/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CapacitiveSensor", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CryptoAccel/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DS1307RTC", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DmxSimple", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DogLcd", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EEPROM", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransfer/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransferI2C/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Entropy", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ethernet/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FNET/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastCRC", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastLED/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN_T4", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexIO_t4/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexiTimer2", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqCount", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasure", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasureMulti", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FrequencyTimer2", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9341_t3", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9488_t3/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/IRremote/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Keypad/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedControl/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedDisplay", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystal/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystalFast", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LittleFS/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LowPower", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MFRC522/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MIDI/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Metro", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MsTimer2", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NativeEthernet/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OSC", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OctoWS2811", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OneWire", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PWMServo", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ping", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PulsePosition", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/QuadEncoder", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RA8875/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RadioHead", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ResponsiveAnalogRead/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SD/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPIFlash", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ST7735_t3/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SdFat/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SerialFlash", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Servo", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ShiftPWM", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Snooze/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftPWM", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftwareSerial", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TFT_ILI9163C", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Talkie", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TeensyThreads", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Time", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimeAlarms", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerOne", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerThree", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TinyGPS", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Tlc5940", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TouchScreen", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/UTFT", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/VirtualWire", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/WS2812Serial", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XBee", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XPT2046_Touchscreen", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/i2c_t3", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ks0108", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ssd1351", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/x10", + "" + ] + }, "defines": [ - "_DEBUG", - "UNICODE", - "_UNICODE" + "PLATFORMIO=60111", + "__IMXRT1062__", + "ARDUINO_TEENSY41", + "USB_SERIAL", + "ARDUINO=10805", + "TEENSYDUINO=158", + "CORE_TEENSY", + "F_CPU=600000000", + "LAYOUT_US_ENGLISH", + "" ], - "cStandard": "c17", - "cppStandard": "c++17", - "intelliSenseMode": "windows-msvc-x64" + "cppStandard": "gnu++14", + "compilerPath": "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc", + "compilerArgs": [ + "-mthumb", + "-mcpu=cortex-m7", + "-mfloat-abi=hard", + "-mfpu=fpv5-d16", + "" + ] } ], "version": 4 -} \ No newline at end of file +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..080e70d --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "platformio.platformio-ide" + ], + "unwantedRecommendations": [ + "ms-vscode.cpptools-extension-pack" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..0a11d3a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,44 @@ +// AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY +// +// PIO Unified Debugger +// +// Documentation: https://docs.platformio.org/page/plus/debugging.html +// Configuration: https://docs.platformio.org/page/projectconf/section_env_debug.html + +{ + "version": "0.2.0", + "configurations": [ + { + "type": "platformio-debug", + "request": "launch", + "name": "PIO Debug", + "executable": "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/build/teensy41/firmware.elf", + "projectEnvName": "teensy41", + "toolchainBinDir": "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin", + "internalConsoleOptions": "openOnSessionStart", + "preLaunchTask": { + "type": "PlatformIO", + "task": "Pre-Debug" + } + }, + { + "type": "platformio-debug", + "request": "launch", + "name": "PIO Debug (skip Pre-Debug)", + "executable": "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/build/teensy41/firmware.elf", + "projectEnvName": "teensy41", + "toolchainBinDir": "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin", + "internalConsoleOptions": "openOnSessionStart" + }, + { + "type": "platformio-debug", + "request": "launch", + "name": "PIO Debug (without uploading)", + "executable": "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/build/teensy41/firmware.elf", + "projectEnvName": "teensy41", + "toolchainBinDir": "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin", + "internalConsoleOptions": "openOnSessionStart", + "loadMode": "manual" + } + ] +} diff --git a/ASTRA/IMU/lib/src/IMU.h b/ASTRA/IMU/lib/src/IMU.h new file mode 100644 index 0000000..f5a4f3a --- /dev/null +++ b/ASTRA/IMU/lib/src/IMU.h @@ -0,0 +1,2 @@ + +#include diff --git a/include/README b/include/README new file mode 100644 index 0000000..194dcd4 --- /dev/null +++ b/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/lib/README b/lib/README new file mode 100644 index 0000000..6debab1 --- /dev/null +++ b/lib/README @@ -0,0 +1,46 @@ + +This directory is intended for project specific (private) libraries. +PlatformIO will compile them to static libraries and link into executable file. + +The source code of each library should be placed in a an own separate directory +("lib/your_library_name/[here are source files]"). + +For example, see a structure of the following two libraries `Foo` and `Bar`: + +|--lib +| | +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html +| | +| |--Foo +| | |- Foo.c +| | |- Foo.h +| | +| |- README --> THIS FILE +| +|- platformio.ini +|--src + |- main.c + +and a contents of `src/main.c`: +``` +#include +#include + +int main (void) +{ + ... +} + +``` + +PlatformIO Library Dependency Finder will find automatically dependent +libraries scanning project source files. + +More information about PlatformIO Library Dependency Finder +- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/platformio.ini b/platformio.ini new file mode 100644 index 0000000..9ee4b23 --- /dev/null +++ b/platformio.ini @@ -0,0 +1,15 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:teensy41] +platform = platformio/teensy@^4.18.0 +board = teensy41 +framework = arduino +lib_deps = adafruit/Adafruit LSM6DS@^4.7.0 diff --git a/test/README b/test/README new file mode 100644 index 0000000..9b1e87b --- /dev/null +++ b/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html From f930b944a09cb661996353c3f3ea0b89590d66b4 Mon Sep 17 00:00:00 2001 From: Vincent Palmerio Date: Sat, 21 Oct 2023 13:44:00 -0400 Subject: [PATCH 17/49] updated gitignore to remove .pio --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index da8d1e2..1617603 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .vscode/settings.json +.pio From 953ba8354cdd0d2b7a7f308260fe2d5d49ff1df8 Mon Sep 17 00:00:00 2001 From: Vincent Palmerio Date: Tue, 24 Oct 2023 19:36:08 -0400 Subject: [PATCH 18/49] Added file and header for all driver errors --- ASTRA/error/DriverError.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ASTRA/error/DriverError.h diff --git a/ASTRA/error/DriverError.h b/ASTRA/error/DriverError.h new file mode 100644 index 0000000..e69de29 From 7072a1c6f5c9d7508c44b7abbdfe5b848bb2f73b Mon Sep 17 00:00:00 2001 From: Vincent Palmerio Date: Tue, 31 Oct 2023 19:17:43 -0400 Subject: [PATCH 19/49] Added error header for all driver errors --- ASTRA/error/DriverError.h | 22 ++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 24 insertions(+) diff --git a/ASTRA/error/DriverError.h b/ASTRA/error/DriverError.h index e69de29..f974dfa 100644 --- a/ASTRA/error/DriverError.h +++ b/ASTRA/error/DriverError.h @@ -0,0 +1,22 @@ +/* +DriverError.h - Error Header/Constants File for Drivers +Description: Error Constants for all Driver Errors that occur +Author: Vincent Palmerio +Created: 10/2/2023 +Last updated: 10/2/2023 +*/ + +#ifndef DRIVER_ERROR_H +#define DRIVER_ERROR_H + +#define NO_ERROR_CODE 0 +#define GENERAL_ERROR_CODE -1 +#define MEMORY_ALLOCATION_ERROR_CODE -2 + +//IMU Error codes are in the 100's +#define FAILED_CALIBRATION_HELPER_INIT -100 +#define NO_CALIBRATION_FOUND -101 +#define FAILED_SENSOR_INIT -102 + + +#endif \ No newline at end of file diff --git a/README.md b/README.md index 8346d2a..4027e46 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ This folder is dedicated to Barometer drivers This folder is dedicated to ESC drivers ### /BMS This folder is dedicated to BMS drivers +### /error +This folder is associated with the error codes that can occur on any drivers. It is meant to be an easy look up for all driver error codes. ## DAQ This folder holds all code associated with test stands and setups that require data aquisition. From 13d4f11daeae36fa2ce497d88fb3ef792384f1b9 Mon Sep 17 00:00:00 2001 From: Vincent Palmerio Date: Tue, 31 Oct 2023 19:19:10 -0400 Subject: [PATCH 20/49] Created IMU driver header and cpp --- ASTRA/.DS_Store | Bin 0 -> 6148 bytes ASTRA/IMU/.DS_Store | Bin 0 -> 6148 bytes ASTRA/IMU/.gitignore | 5 ++ ASTRA/IMU/.vscode/extensions.json | 10 +++ ASTRA/IMU/include/LSM6DS_LIS3MDL.h | 36 ++++++++ ASTRA/IMU/lib/src/IMU.h | 2 - ASTRA/IMU/platformio.ini | 24 ++++++ ASTRA/IMU/src/.DS_Store | Bin 0 -> 6148 bytes ASTRA/IMU/src/IMU.cpp | 132 +++++++++++++++++++++++++++++ ASTRA/IMU/src/IMU.h | 55 ++++++++++++ ASTRA/IMU/src/main.cpp | 12 +++ 11 files changed, 274 insertions(+), 2 deletions(-) create mode 100644 ASTRA/.DS_Store create mode 100644 ASTRA/IMU/.DS_Store create mode 100644 ASTRA/IMU/.gitignore create mode 100644 ASTRA/IMU/.vscode/extensions.json create mode 100644 ASTRA/IMU/include/LSM6DS_LIS3MDL.h delete mode 100644 ASTRA/IMU/lib/src/IMU.h create mode 100644 ASTRA/IMU/platformio.ini create mode 100644 ASTRA/IMU/src/.DS_Store create mode 100644 ASTRA/IMU/src/IMU.cpp create mode 100644 ASTRA/IMU/src/IMU.h create mode 100644 ASTRA/IMU/src/main.cpp diff --git a/ASTRA/.DS_Store b/ASTRA/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..85ade229b9a2b7ca59c42856ac2f033c9ce02dc8 GIT binary patch literal 6148 zcmeHK%}(1u5S}HWaX^)FXeBO{R^l3g3!xI~#iVfHzyjt@6XISUL(Wg*v}cBGGe~YKoEjDMqmCWKI~6uijgplli!5I0hU8^TPn04;qy)5G*b7 z(Se3b0K_T|vtXNQ3ChuefnaG7Jt)eiBHC0XC5E!;IIblw5G*a)bWl=!D0#Dz3PthT z@%fs=K?N3_bqqKLCK;&MZiDXsz5mz$lS!`U7;p@HC}c literal 0 HcmV?d00001 diff --git a/ASTRA/IMU/.DS_Store b/ASTRA/IMU/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..832e6665c11e28f892672d18d9c2a2966b10868d GIT binary patch literal 6148 zcmeHKO>fgM7=GObnr;I1z@%M}B5|!o7zJtKl6B+2l^{3(DoGQDMHW{{x*n=ZIdA`A ze}OB%g#W?`9)A=q4crhym0!tz9Q%14zmJvIF%hxxJb6SkAR-q!yyV%rX@fK}jsQ$T*ZJ9L2WmQ#iD>-&9?iD{gP7~@C|>&5=K*l+nD+rem*sU9;diDCw>k0zp+l&xplke z_S{|fefUW%!YZofd4;{$#MfT#o$F(0k$^u7=+7=+GZ}qsLEItG>JU;Ni2Elh4_CE-n!tj3HYq zyJK(-a+ggs7h#cSB9}X~X0KTmw?hH5ukP-4gkz(y3RngHq5?8McqkGBgSAGLI#8)A z0MJ3VGPLDgLi%_H1B10jjKG+71!`Ajt{6Uz+kOWyAv~)4`$xX%ngO9w_|=! z(TN2bZEY2>3N#hy>c@dR|DXT){@--6PgVh|z*Z^1oYU}hjF8OP+6qpdwI0d`6ls!I nYg8_%%yFz5@+jU%QHC*3Hh_V_S|fU3_D4X;U@NP@KULr-Ez6*# literal 0 HcmV?d00001 diff --git a/ASTRA/IMU/.gitignore b/ASTRA/IMU/.gitignore new file mode 100644 index 0000000..89cc49c --- /dev/null +++ b/ASTRA/IMU/.gitignore @@ -0,0 +1,5 @@ +.pio +.vscode/.browse.c_cpp.db* +.vscode/c_cpp_properties.json +.vscode/launch.json +.vscode/ipch diff --git a/ASTRA/IMU/.vscode/extensions.json b/ASTRA/IMU/.vscode/extensions.json new file mode 100644 index 0000000..080e70d --- /dev/null +++ b/ASTRA/IMU/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "platformio.platformio-ide" + ], + "unwantedRecommendations": [ + "ms-vscode.cpptools-extension-pack" + ] +} diff --git a/ASTRA/IMU/include/LSM6DS_LIS3MDL.h b/ASTRA/IMU/include/LSM6DS_LIS3MDL.h new file mode 100644 index 0000000..10baa7c --- /dev/null +++ b/ASTRA/IMU/include/LSM6DS_LIS3MDL.h @@ -0,0 +1,36 @@ +#include +Adafruit_LIS3MDL lis3mdl; + +// Can change this to be LSM6DSOX or whatever ya like +#include +Adafruit_LSM6DS33 lsm6ds; + +Adafruit_Sensor* accelerometer; +Adafruit_Sensor* gyroscope; +Adafruit_LIS3MDL* magnetometer; + + +bool init_sensors(void) { + if (!lsm6ds.begin_I2C() || !lis3mdl.begin_I2C()) { + return false; + } + accelerometer = lsm6ds.getAccelerometerSensor(); + gyroscope = lsm6ds.getGyroSensor(); + magnetometer = &lis3mdl; + + return true; +} + +void setup_sensors(void) { + // set lowest range + lsm6ds.setAccelRange(LSM6DS_ACCEL_RANGE_2_G); + lsm6ds.setGyroRange(LSM6DS_GYRO_RANGE_250_DPS); + lis3mdl.setRange(LIS3MDL_RANGE_4_GAUSS); + + // set slightly above refresh rate + lsm6ds.setAccelDataRate(LSM6DS_RATE_104_HZ); + lsm6ds.setGyroDataRate(LSM6DS_RATE_104_HZ); + lis3mdl.setDataRate(LIS3MDL_DATARATE_1000_HZ); + lis3mdl.setPerformanceMode(LIS3MDL_MEDIUMMODE); + lis3mdl.setOperationMode(LIS3MDL_CONTINUOUSMODE); +} \ No newline at end of file diff --git a/ASTRA/IMU/lib/src/IMU.h b/ASTRA/IMU/lib/src/IMU.h deleted file mode 100644 index f5a4f3a..0000000 --- a/ASTRA/IMU/lib/src/IMU.h +++ /dev/null @@ -1,2 +0,0 @@ - -#include diff --git a/ASTRA/IMU/platformio.ini b/ASTRA/IMU/platformio.ini new file mode 100644 index 0000000..165acbb --- /dev/null +++ b/ASTRA/IMU/platformio.ini @@ -0,0 +1,24 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:teensy41] +platform = platformio/teensy@^4.18.0 +board = teensy41 +framework = arduino +lib_deps = + adafruit/Adafruit LSM6DS@^4.7.0 + adafruit/Adafruit LIS3MDL@^1.2.1 + adafruit/Adafruit AHRS@^2.3.3 + adafruit/Adafruit Unified Sensor@^1.1.13 + adafruit/Adafruit BusIO@^1.14.5 + Wire + SPI + adafruit/Adafruit Sensor Calibration@^1.1.5 + EEPROM diff --git a/ASTRA/IMU/src/.DS_Store b/ASTRA/IMU/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..7bdc9ab0efc3034cf4c71c366c6fc20f33ec0e10 GIT binary patch literal 6148 zcmeHK!AiqG5Z!I7O(;SR3OxqA7LBzE;w8p<@M=U4Dm7_}24hy5)Er77XZ<0+#NW}G z-HlMH7Y~AE24>%8c4ou84Lcde822X84r3N$%m78KnJ|1KxQ@CYHEpQ_a@<1MUbpHatz{&hH3TwmziDM6_2}WKa5(-@>OP&T_|j=e2rcWwmKEjh1oa z-;2V}gM5;C!T1WF&V@+AY953a@u(PB>&GI^gE$?HWk4K_z~%ZfP9srxVvv0uaNRp_6%OmJ_AeExaK`1EVITcwt~(U2TMuqa zcg9_XG!g^Ez&r!k`+-printSensorDetails(); + gyroscope->printSensorDetails(); + magnetometer->printSensorDetails(); +#endif + + setup_sensors(); + filter.begin(FILTER_UPDATE_RATE_HZ); + timestamp = millis(); + + Wire.setClock(400000); // 400KHz + + return NO_ERROR_CODE; +} + +int updateIMU() { + // float roll, pitch, heading; + // float gx, gy, gz; + + static uint8_t counter = 0; + + // if ((millis() - timestamp) < (1000 / FILTER_UPDATE_RATE_HZ)) { + // return; + // } + timestamp = millis(); + // Read the motion sensors + sensors_event_t accel, gyro, mag; + accelerometer->getEvent(&accel); + gyroscope->getEvent(&gyro); + magnetometer->getEvent(&mag); + +#if defined(AHRS_DEBUG_OUTPUT) + Serial.print("I2C took "); Serial.print(millis()-timestamp); Serial.println(" ms"); +#endif + + cal.calibrate(mag); + cal.calibrate(accel); + cal.calibrate(gyro); + + // Gyroscope needs to be converted from Rad/s to Degree/s + // the rest are not unit-important + gx = gyro.gyro.x * SENSORS_RADS_TO_DPS; + gy = gyro.gyro.y * SENSORS_RADS_TO_DPS; + gz = gyro.gyro.z * SENSORS_RADS_TO_DPS; + + // Update the SensorFusion filter + filter.update(gx, gy, gz, + accel.acceleration.x, accel.acceleration.y, accel.acceleration.z, + mag.magnetic.x, mag.magnetic.y, mag.magnetic.z); +#if defined(AHRS_DEBUG_OUTPUT) + Serial.print("Update took "); Serial.print(millis()-timestamp); Serial.println(" ms"); +#endif + + // only print the calculated output once in a while + // if (counter++ <= PRINT_EVERY_N_UPDATES) { + // return; + // } + // reset the counter + //counter = 0; + +#if defined(ASTRA_FULL_DEBUG) or defined(ASTRA_IMU_DEBUG) + Serial.print("Raw: "); + Serial.print(accel.acceleration.x, 4); Serial.print(", "); + Serial.print(accel.acceleration.y, 4); Serial.print(", "); + Serial.print(accel.acceleration.z, 4); Serial.print(", "); + Serial.print(gx, 4); Serial.print(", "); + Serial.print(gy, 4); Serial.print(", "); + Serial.print(gz, 4); Serial.print(", "); + Serial.print(mag.magnetic.x, 4); Serial.print(", "); + Serial.print(mag.magnetic.y, 4); Serial.print(", "); + Serial.print(mag.magnetic.z, 4); Serial.println(""); +#endif + + // print the heading, pitch and roll + roll = filter.getRoll(); + pitch = filter.getPitch(); + heading = filter.getYaw(); + Serial.print("Orientation: "); + Serial.print(heading); + Serial.print(", "); + Serial.print(pitch); + Serial.print(", "); + Serial.println(roll); + + //float qw, qx, qy, qz; + filter.getQuaternion(&qw, &qx, &qy, &qz); + Serial.print("Quaternion: "); + Serial.print(qw, 4); + Serial.print(", "); + Serial.print(qx, 4); + Serial.print(", "); + Serial.print(qy, 4); + Serial.print(", "); + Serial.println(qz, 4); + +#if defined(AHRS_DEBUG_OUTPUT) + Serial.print("Took "); Serial.print(millis()-timestamp); Serial.println(" ms"); +#endif + + return NO_ERROR_CODE; + +} + diff --git a/ASTRA/IMU/src/IMU.h b/ASTRA/IMU/src/IMU.h new file mode 100644 index 0000000..e6b4cfc --- /dev/null +++ b/ASTRA/IMU/src/IMU.h @@ -0,0 +1,55 @@ + +#ifndef IMU_H +#define IMU_H + +#include +#include +#include + +#include +#include + +//uncomment to print data to console for just IMU +//#define ASTRA_IMU_DEBUG +#define FILTER_UPDATE_RATE_HZ 100 +#define PRINT_EVERY_N_UPDATES 10 + + +// Full orientation sensing using NXP/Madgwick/Mahony and a range of 9-DoF +// sensor sets. +// You *must* perform a magnetic calibration before this code will work. +// +// To view this data, use the Arduino Serial Monitor to watch the +// scrolling angles, or run the OrientationVisualiser example in Processing. +// Based on https://github.com/PaulStoffregen/NXPMotionSense with adjustments +// to Adafruit Unified Sensor interface + + + +#if defined(ADAFRUIT_SENSOR_CALIBRATION_USE_EEPROM) + static Adafruit_Sensor_Calibration_EEPROM cal; +#else + Adafruit_Sensor_Calibration_SDFat cal; +#endif + +#define FILTER_UPDATE_RATE_HZ 100 +#define PRINT_EVERY_N_UPDATES 10 +//#define AHRS_DEBUG_OUTPUT + + +extern float roll, pitch, heading; +extern float gx, gy, gz; //degrees per second on gyro +extern float qw, qx, qy, qz; //quaternarion +static uint32_t timestamp; + +// slower == better quality output +static Adafruit_NXPSensorFusion filter; // slowest + +extern int setupIMU(); +extern int updateIMU(); + +#endif + + + + diff --git a/ASTRA/IMU/src/main.cpp b/ASTRA/IMU/src/main.cpp new file mode 100644 index 0000000..f1aa191 --- /dev/null +++ b/ASTRA/IMU/src/main.cpp @@ -0,0 +1,12 @@ +#include "IMU.h" + +void setup() { + setupIMU(); +} + +void loop() { + updateIMU(); + Serial.print("test"); + Serial.print(heading); + +} \ No newline at end of file From 70743105a95bca26ac169a96073b39d01845c4a6 Mon Sep 17 00:00:00 2001 From: Vincent Palmerio Date: Tue, 31 Oct 2023 19:20:04 -0400 Subject: [PATCH 21/49] Reorganized platformio project to exist within library folder --- .DS_Store | Bin 0 -> 6148 bytes .pio/build/project.checksum | 1 - .pio/build/teensy41/idedata.json | 1 - .../Adafruit BusIO/.github/ISSUE_TEMPLATE.md | 46 - .../.github/PULL_REQUEST_TEMPLATE.md | 26 - .../.github/workflows/githubci.yml | 33 - .pio/libdeps/teensy41/Adafruit BusIO/.piopm | 1 - .../Adafruit_BusIO_Register.cpp | 365 ------- .../Adafruit BusIO/Adafruit_BusIO_Register.h | 105 -- .../Adafruit BusIO/Adafruit_I2CDevice.cpp | 317 ------- .../Adafruit BusIO/Adafruit_I2CDevice.h | 36 - .../Adafruit BusIO/Adafruit_I2CRegister.h | 10 - .../Adafruit BusIO/Adafruit_SPIDevice.cpp | 508 ---------- .../Adafruit BusIO/Adafruit_SPIDevice.h | 142 --- .../teensy41/Adafruit BusIO/CMakeLists.txt | 11 - .pio/libdeps/teensy41/Adafruit BusIO/LICENSE | 21 - .../libdeps/teensy41/Adafruit BusIO/README.md | 8 - .../teensy41/Adafruit BusIO/component.mk | 1 - .../i2c_address_detect/i2c_address_detect.ino | 21 - .../examples/i2c_readwrite/i2c_readwrite.ino | 41 - .../examples/i2c_registers/i2c_registers.ino | 38 - .../i2corspi_register/i2corspi_register.ino | 38 - .../examples/spi_modetest/spi_modetest.ino | 29 - .../examples/spi_readwrite/spi_readwrite.ino | 39 - .../spi_register_bits/spi_register_bits.ino | 192 ---- .../examples/spi_registers/spi_registers.ino | 34 - .../Adafruit BusIO/library.properties | 9 - .../Adafruit LSM6DS/.github/ISSUE_TEMPLATE.md | 46 - .../.github/PULL_REQUEST_TEMPLATE.md | 26 - .../.github/workflows/githubci.yml | 32 - .../teensy41/Adafruit LSM6DS/.gitignore | 5 - .pio/libdeps/teensy41/Adafruit LSM6DS/.piopm | 1 - .../Adafruit LSM6DS/Adafruit_ISM330DHCX.cpp | 35 - .../Adafruit LSM6DS/Adafruit_ISM330DHCX.h | 38 - .../Adafruit LSM6DS/Adafruit_LSM6DS.cpp | 895 ------------------ .../Adafruit LSM6DS/Adafruit_LSM6DS.h | 251 ----- .../Adafruit LSM6DS/Adafruit_LSM6DS3.cpp | 51 - .../Adafruit LSM6DS/Adafruit_LSM6DS3.h | 42 - .../Adafruit LSM6DS/Adafruit_LSM6DS33.cpp | 40 - .../Adafruit LSM6DS/Adafruit_LSM6DS33.h | 38 - .../Adafruit LSM6DS/Adafruit_LSM6DS3TRC.cpp | 71 -- .../Adafruit LSM6DS/Adafruit_LSM6DS3TRC.h | 43 - .../Adafruit LSM6DS/Adafruit_LSM6DSL.cpp | 49 - .../Adafruit LSM6DS/Adafruit_LSM6DSL.h | 42 - .../Adafruit LSM6DS/Adafruit_LSM6DSO32.cpp | 143 --- .../Adafruit LSM6DS/Adafruit_LSM6DSO32.h | 49 - .../Adafruit LSM6DS/Adafruit_LSM6DSOX.cpp | 90 -- .../Adafruit LSM6DS/Adafruit_LSM6DSOX.h | 53 -- .../teensy41/Adafruit LSM6DS/README.md | 35 - .../Adafruit LSM6DS/code-of-conduct.md | 127 --- .../adafruit_ism330dhcx_test.ino | 198 ---- .../adafruit_lsm6ds33_test.ino | 197 ---- .../adafruit_lsm6ds3trc_test.ino | 198 ---- .../adafruit_lsm6ds_pedometer.ino | 52 - .../adafruit_lsm6ds_shake.ino | 44 - .../adafruit_lsm6ds_unifiedsensors.ino | 85 -- .../adafruit_lsm6dso32_test.ino | 196 ---- .../adafruit_lsm6dsox_test.ino | 196 ---- .../Adafruit LSM6DS/library.properties | 10 - .../teensy41/Adafruit LSM6DS/license.txt | 26 - .../Adafruit Unified Sensor/.gitignore | 108 --- .../Adafruit_Sensor.cpp | 120 --- .../Adafruit Unified Sensor/Adafruit_Sensor.h | 224 ----- .../Adafruit Unified Sensor/LICENSE.txt | 202 ---- .../Adafruit Unified Sensor/README.md | 271 ------ .../examples/sensortest/sensortest.ino | 153 --- .../library.properties | 11 - .pio/libdeps/teensy41/integrity.dat | 1 - .vscode/c_cpp_properties.json | 253 ----- platformio.ini | 15 - 70 files changed, 6835 deletions(-) create mode 100644 .DS_Store delete mode 100644 .pio/build/project.checksum delete mode 100644 .pio/build/teensy41/idedata.json delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/.github/ISSUE_TEMPLATE.md delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/.github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/.github/workflows/githubci.yml delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/.piopm delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/Adafruit_BusIO_Register.cpp delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/Adafruit_BusIO_Register.h delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CDevice.cpp delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CDevice.h delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CRegister.h delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/Adafruit_SPIDevice.cpp delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/Adafruit_SPIDevice.h delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/CMakeLists.txt delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/LICENSE delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/README.md delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/component.mk delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_address_detect/i2c_address_detect.ino delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_readwrite/i2c_readwrite.ino delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_registers/i2c_registers.ino delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/examples/i2corspi_register/i2corspi_register.ino delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/examples/spi_modetest/spi_modetest.ino delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/examples/spi_readwrite/spi_readwrite.ino delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/examples/spi_register_bits/spi_register_bits.ino delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/examples/spi_registers/spi_registers.ino delete mode 100644 .pio/libdeps/teensy41/Adafruit BusIO/library.properties delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/.github/ISSUE_TEMPLATE.md delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/.github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/.github/workflows/githubci.yml delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/.gitignore delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/.piopm delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_ISM330DHCX.cpp delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_ISM330DHCX.h delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS.cpp delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS.h delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3.cpp delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3.h delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS33.cpp delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS33.h delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3TRC.cpp delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3TRC.h delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSL.cpp delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSL.h delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSO32.cpp delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSO32.h delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSOX.cpp delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSOX.h delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/README.md delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/code-of-conduct.md delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_ism330dhcx_test/adafruit_ism330dhcx_test.ino delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds33_test/adafruit_lsm6ds33_test.ino delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds3trc_test/adafruit_lsm6ds3trc_test.ino delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_pedometer/adafruit_lsm6ds_pedometer.ino delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_shake/adafruit_lsm6ds_shake.ino delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_unifiedsensors/adafruit_lsm6ds_unifiedsensors.ino delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6dso32_test/adafruit_lsm6dso32_test.ino delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6dsox_test/adafruit_lsm6dsox_test.ino delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/library.properties delete mode 100644 .pio/libdeps/teensy41/Adafruit LSM6DS/license.txt delete mode 100644 .pio/libdeps/teensy41/Adafruit Unified Sensor/.gitignore delete mode 100644 .pio/libdeps/teensy41/Adafruit Unified Sensor/Adafruit_Sensor.cpp delete mode 100644 .pio/libdeps/teensy41/Adafruit Unified Sensor/Adafruit_Sensor.h delete mode 100644 .pio/libdeps/teensy41/Adafruit Unified Sensor/LICENSE.txt delete mode 100644 .pio/libdeps/teensy41/Adafruit Unified Sensor/README.md delete mode 100644 .pio/libdeps/teensy41/Adafruit Unified Sensor/examples/sensortest/sensortest.ino delete mode 100644 .pio/libdeps/teensy41/Adafruit Unified Sensor/library.properties delete mode 100644 .pio/libdeps/teensy41/integrity.dat delete mode 100644 .vscode/c_cpp_properties.json delete mode 100644 platformio.ini diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..1d2af23a88347837e486901b28345317a899260f GIT binary patch literal 6148 zcmeHKy^hmB5S~5zh{Fjf1xVK*twb9g<_JiL#tFHCf`ao23P2%_EwJ!;Pq9OaD3WV< z2VQ}eC*fVFU}koaHqLP+LSaXm{r2Y@+w*CEyZ|6Zi}W5q4*&vmLjO7zml%zcZ`q#d zxq&G78N;WAnk9uwwz#gtDc}_N_Y|PDyAMN%;S5f}Uca;@4AGB%vhk-|%w$qRx1&RJIM z#hRfWFl%SD<7`^m`A|cKdDbm0Xl~kCVDm~d>moR~lH~@S0#1SdQ32W?BsyVau+hj{ z2Nrw*uACHh-* qGU7EFIRp!H9CL+^;zM*c9FtT*j0`p!u?Nll2(S#Ua0>iY1%3fLkP*B9 literal 0 HcmV?d00001 diff --git a/.pio/build/project.checksum b/.pio/build/project.checksum deleted file mode 100644 index 39b25ff..0000000 --- a/.pio/build/project.checksum +++ /dev/null @@ -1 +0,0 @@ -74370b8e1512dbd1be4c1bdbf600b2258108a598 \ No newline at end of file diff --git a/.pio/build/teensy41/idedata.json b/.pio/build/teensy41/idedata.json deleted file mode 100644 index 06b806d..0000000 --- a/.pio/build/teensy41/idedata.json +++ /dev/null @@ -1 +0,0 @@ -{"build_type": "release", "env_name": "teensy41", "libsource_dirs": ["/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/lib", "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41", "/Users/vpalmerio/.platformio/lib", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries"], "defines": ["PLATFORMIO=60111", "__IMXRT1062__", "ARDUINO_TEENSY41", "USB_SERIAL", "ARDUINO=10805", "TEENSYDUINO=158", "CORE_TEENSY", "F_CPU=600000000", "LAYOUT_US_ENGLISH"], "includes": {"build": ["/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/include", "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/src", "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/include", "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/src", "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit LSM6DS", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/cores/teensy4"], "compatlib": ["/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit BusIO", "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit LSM6DS", "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit Unified Sensor", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPI", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire/utility", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ADC", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AccelStepper/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_NeoPixel", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_STMPE610", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_VS1053", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001/utility", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AltSoftSerial", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Artnet", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio/utility", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce2/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CapacitiveSensor", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CryptoAccel/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DS1307RTC", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DmxSimple", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DogLcd", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EEPROM", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransfer/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransferI2C/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder/utility", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Entropy", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ethernet/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FNET/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastCRC", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastLED/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN_T4", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexIO_t4/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexiTimer2", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqCount", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasure", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasureMulti", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FrequencyTimer2", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9341_t3", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9488_t3/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/IRremote/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Keypad/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedControl/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedDisplay", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystal/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystalFast", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LittleFS/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LowPower", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MFRC522/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MIDI/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Metro", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MsTimer2", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense/utility", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NativeEthernet/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OSC", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OctoWS2811", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OneWire", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard/utility", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PWMServo", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ping", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PulsePosition", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/QuadEncoder", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RA8875/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RadioHead", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ResponsiveAnalogRead/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SD/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPIFlash", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ST7735_t3/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SdFat/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SerialFlash", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Servo", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ShiftPWM", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Snooze/src", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftPWM", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftwareSerial", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TFT_ILI9163C", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Talkie", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TeensyThreads", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Time", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimeAlarms", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerOne", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerThree", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TinyGPS", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Tlc5940", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TouchScreen", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36/utility", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/UTFT", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/VirtualWire", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/WS2812Serial", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XBee", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XPT2046_Touchscreen", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/i2c_t3", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ks0108", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ssd1351", "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/x10"], "toolchain": ["/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1", "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include/c++/11.3.1/arm-none-eabi", "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include", "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/lib/gcc/arm-none-eabi/11.3.1/include-fixed", "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/arm-none-eabi/include"]}, "cc_flags": ["-Wall", "-ffunction-sections", "-fdata-sections", "-mthumb", "-mcpu=cortex-m7", "-nostdlib", "-mfloat-abi=hard", "-mfpu=fpv5-d16", "-O2"], "cxx_flags": ["-fno-exceptions", "-felide-constructors", "-fno-rtti", "-std=gnu++14", "-Wno-error=narrowing", "-fpermissive", "-fno-threadsafe-statics", "-Wall", "-ffunction-sections", "-fdata-sections", "-mthumb", "-mcpu=cortex-m7", "-nostdlib", "-mfloat-abi=hard", "-mfpu=fpv5-d16", "-O2"], "cc_path": "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc", "cxx_path": "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-g++", "gdb_path": "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gdb", "prog_path": "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/build/teensy41/firmware.elf", "svd_path": null, "compiler_type": "gcc", "targets": [{"name": "upload", "group": "Platform", "title": "Upload"}], "extra": {"flash_images": []}} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/.github/ISSUE_TEMPLATE.md b/.pio/libdeps/teensy41/Adafruit BusIO/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index f0e2614..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,46 +0,0 @@ -Thank you for opening an issue on an Adafruit Arduino library repository. To -improve the speed of resolution please review the following guidelines and -common troubleshooting steps below before creating the issue: - -- **Do not use GitHub issues for troubleshooting projects and issues.** Instead use - the forums at http://forums.adafruit.com to ask questions and troubleshoot why - something isn't working as expected. In many cases the problem is a common issue - that you will more quickly receive help from the forum community. GitHub issues - are meant for known defects in the code. If you don't know if there is a defect - in the code then start with troubleshooting on the forum first. - -- **If following a tutorial or guide be sure you didn't miss a step.** Carefully - check all of the steps and commands to run have been followed. Consult the - forum if you're unsure or have questions about steps in a guide/tutorial. - -- **For Arduino projects check these very common issues to ensure they don't apply**: - - - For uploading sketches or communicating with the board make sure you're using - a **USB data cable** and **not** a **USB charge-only cable**. It is sometimes - very hard to tell the difference between a data and charge cable! Try using the - cable with other devices or swapping to another cable to confirm it is not - the problem. - - - **Be sure you are supplying adequate power to the board.** Check the specs of - your board and plug in an external power supply. In many cases just - plugging a board into your computer is not enough to power it and other - peripherals. - - - **Double check all soldering joints and connections.** Flakey connections - cause many mysterious problems. See the [guide to excellent soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering/tools) for examples of good solder joints. - - - **Ensure you are using an official Arduino or Adafruit board.** We can't - guarantee a clone board will have the same functionality and work as expected - with this code and don't support them. - -If you're sure this issue is a defect in the code and checked the steps above -please fill in the following fields to provide enough troubleshooting information. -You may delete the guideline and text above to just leave the following details: - -- Arduino board: **INSERT ARDUINO BOARD NAME/TYPE HERE** - -- Arduino IDE version (found in Arduino -> About Arduino menu): **INSERT ARDUINO - VERSION HERE** - -- List the steps to reproduce the problem below (if possible attach a sketch or - copy the sketch code in too): **LIST REPRO STEPS BELOW** diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/.github/PULL_REQUEST_TEMPLATE.md b/.pio/libdeps/teensy41/Adafruit BusIO/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 7b641eb..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,26 +0,0 @@ -Thank you for creating a pull request to contribute to Adafruit's GitHub code! -Before you open the request please review the following guidelines and tips to -help it be more easily integrated: - -- **Describe the scope of your change--i.e. what the change does and what parts - of the code were modified.** This will help us understand any risks of integrating - the code. - -- **Describe any known limitations with your change.** For example if the change - doesn't apply to a supported platform of the library please mention it. - -- **Please run any tests or examples that can exercise your modified code.** We - strive to not break users of the code and running tests/examples helps with this - process. - -Thank you again for contributing! We will try to test and integrate the change -as soon as we can, but be aware we have many GitHub repositories to manage and -can't immediately respond to every request. There is no need to bump or check in -on a pull request (it will clutter the discussion of the request). - -Also don't be worried if the request is closed or not integrated--sometimes the -priorities of Adafruit's GitHub code (education, ease of use) might not match the -priorities of the pull request. Don't fret, the open source community thrives on -forks and GitHub makes it easy to keep your changes in a forked repo. - -After reviewing the guidelines above you can delete this text from the pull request. diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/.github/workflows/githubci.yml b/.pio/libdeps/teensy41/Adafruit BusIO/.github/workflows/githubci.yml deleted file mode 100644 index 8a57d75..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/.github/workflows/githubci.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Arduino Library CI - -on: [pull_request, push, repository_dispatch] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - uses: actions/checkout@v3 - - uses: actions/checkout@v3 - with: - repository: adafruit/ci-arduino - path: ci - - - name: Install the prerequisites - run: bash ci/actions_install.sh - - - name: Check for correct code formatting with clang-format - run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r . - - - name: Check for correct documentation with doxygen - env: - GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }} - PRETTYNAME : "Adafruit Bus IO Library" - run: bash ci/doxy_gen_and_deploy.sh - - - name: Test the code on supported platforms - run: python3 ci/build_platform.py main_platforms zero feather32u4 - diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/.piopm b/.pio/libdeps/teensy41/Adafruit BusIO/.piopm deleted file mode 100644 index 35c04c9..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/.piopm +++ /dev/null @@ -1 +0,0 @@ -{"type": "library", "name": "Adafruit BusIO", "version": "1.14.5", "spec": {"owner": "adafruit", "id": 6214, "name": "Adafruit BusIO", "requirements": null, "uri": null}} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_BusIO_Register.cpp b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_BusIO_Register.cpp deleted file mode 100644 index a28193f..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_BusIO_Register.cpp +++ /dev/null @@ -1,365 +0,0 @@ -#include - -#if !defined(SPI_INTERFACES_COUNT) || \ - (defined(SPI_INTERFACES_COUNT) && (SPI_INTERFACES_COUNT > 0)) - -/*! - * @brief Create a register we access over an I2C Device (which defines the - * bus and address) - * @param i2cdevice The I2CDevice to use for underlying I2C access - * @param reg_addr The address pointer value for the I2C/SMBus register, can - * be 8 or 16 bits - * @param width The width of the register data itself, defaults to 1 byte - * @param byteorder The byte order of the register (used when width is > 1), - * defaults to LSBFIRST - * @param address_width The width of the register address itself, defaults - * to 1 byte - */ -Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, - uint16_t reg_addr, - uint8_t width, - uint8_t byteorder, - uint8_t address_width) { - _i2cdevice = i2cdevice; - _spidevice = nullptr; - _addrwidth = address_width; - _address = reg_addr; - _byteorder = byteorder; - _width = width; -} - -/*! - * @brief Create a register we access over an SPI Device (which defines the - * bus and CS pin) - * @param spidevice The SPIDevice to use for underlying SPI access - * @param reg_addr The address pointer value for the SPI register, can - * be 8 or 16 bits - * @param type The method we use to read/write data to SPI (which is not - * as well defined as I2C) - * @param width The width of the register data itself, defaults to 1 byte - * @param byteorder The byte order of the register (used when width is > 1), - * defaults to LSBFIRST - * @param address_width The width of the register address itself, defaults - * to 1 byte - */ -Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_SPIDevice *spidevice, - uint16_t reg_addr, - Adafruit_BusIO_SPIRegType type, - uint8_t width, - uint8_t byteorder, - uint8_t address_width) { - _spidevice = spidevice; - _spiregtype = type; - _i2cdevice = nullptr; - _addrwidth = address_width; - _address = reg_addr; - _byteorder = byteorder; - _width = width; -} - -/*! - * @brief Create a register we access over an I2C or SPI Device. This is a - * handy function because we can pass in nullptr for the unused interface, - * allowing libraries to mass-define all the registers - * @param i2cdevice The I2CDevice to use for underlying I2C access, if - * nullptr we use SPI - * @param spidevice The SPIDevice to use for underlying SPI access, if - * nullptr we use I2C - * @param reg_addr The address pointer value for the I2C/SMBus/SPI register, - * can be 8 or 16 bits - * @param type The method we use to read/write data to SPI (which is not - * as well defined as I2C) - * @param width The width of the register data itself, defaults to 1 byte - * @param byteorder The byte order of the register (used when width is > 1), - * defaults to LSBFIRST - * @param address_width The width of the register address itself, defaults - * to 1 byte - */ -Adafruit_BusIO_Register::Adafruit_BusIO_Register( - Adafruit_I2CDevice *i2cdevice, Adafruit_SPIDevice *spidevice, - Adafruit_BusIO_SPIRegType type, uint16_t reg_addr, uint8_t width, - uint8_t byteorder, uint8_t address_width) { - _spidevice = spidevice; - _i2cdevice = i2cdevice; - _spiregtype = type; - _addrwidth = address_width; - _address = reg_addr; - _byteorder = byteorder; - _width = width; -} - -/*! - * @brief Write a buffer of data to the register location - * @param buffer Pointer to data to write - * @param len Number of bytes to write - * @return True on successful write (only really useful for I2C as SPI is - * uncheckable) - */ -bool Adafruit_BusIO_Register::write(uint8_t *buffer, uint8_t len) { - - uint8_t addrbuffer[2] = {(uint8_t)(_address & 0xFF), - (uint8_t)(_address >> 8)}; - - if (_i2cdevice) { - return _i2cdevice->write(buffer, len, true, addrbuffer, _addrwidth); - } - if (_spidevice) { - if (_spiregtype == ADDRESSED_OPCODE_BIT0_LOW_TO_WRITE) { - // very special case! - - // pass the special opcode address which we set as the high byte of the - // regaddr - addrbuffer[0] = - (uint8_t)(_address >> 8) & ~0x01; // set bottom bit low to write - // the 'actual' reg addr is the second byte then - addrbuffer[1] = (uint8_t)(_address & 0xFF); - // the address appears to be a byte longer - return _spidevice->write(buffer, len, addrbuffer, _addrwidth + 1); - } - - if (_spiregtype == ADDRBIT8_HIGH_TOREAD) { - addrbuffer[0] &= ~0x80; - } - if (_spiregtype == ADDRBIT8_HIGH_TOWRITE) { - addrbuffer[0] |= 0x80; - } - if (_spiregtype == AD8_HIGH_TOREAD_AD7_HIGH_TOINC) { - addrbuffer[0] &= ~0x80; - addrbuffer[0] |= 0x40; - } - return _spidevice->write(buffer, len, addrbuffer, _addrwidth); - } - return false; -} - -/*! - * @brief Write up to 4 bytes of data to the register location - * @param value Data to write - * @param numbytes How many bytes from 'value' to write - * @return True on successful write (only really useful for I2C as SPI is - * uncheckable) - */ -bool Adafruit_BusIO_Register::write(uint32_t value, uint8_t numbytes) { - if (numbytes == 0) { - numbytes = _width; - } - if (numbytes > 4) { - return false; - } - - // store a copy - _cached = value; - - for (int i = 0; i < numbytes; i++) { - if (_byteorder == LSBFIRST) { - _buffer[i] = value & 0xFF; - } else { - _buffer[numbytes - i - 1] = value & 0xFF; - } - value >>= 8; - } - return write(_buffer, numbytes); -} - -/*! - * @brief Read data from the register location. This does not do any error - * checking! - * @return Returns 0xFFFFFFFF on failure, value otherwise - */ -uint32_t Adafruit_BusIO_Register::read(void) { - if (!read(_buffer, _width)) { - return -1; - } - - uint32_t value = 0; - - for (int i = 0; i < _width; i++) { - value <<= 8; - if (_byteorder == LSBFIRST) { - value |= _buffer[_width - i - 1]; - } else { - value |= _buffer[i]; - } - } - - return value; -} - -/*! - * @brief Read cached data from last time we wrote to this register - * @return Returns 0xFFFFFFFF on failure, value otherwise - */ -uint32_t Adafruit_BusIO_Register::readCached(void) { return _cached; } - -/*! - * @brief Read a buffer of data from the register location - * @param buffer Pointer to data to read into - * @param len Number of bytes to read - * @return True on successful write (only really useful for I2C as SPI is - * uncheckable) - */ -bool Adafruit_BusIO_Register::read(uint8_t *buffer, uint8_t len) { - uint8_t addrbuffer[2] = {(uint8_t)(_address & 0xFF), - (uint8_t)(_address >> 8)}; - - if (_i2cdevice) { - return _i2cdevice->write_then_read(addrbuffer, _addrwidth, buffer, len); - } - if (_spidevice) { - if (_spiregtype == ADDRESSED_OPCODE_BIT0_LOW_TO_WRITE) { - // very special case! - - // pass the special opcode address which we set as the high byte of the - // regaddr - addrbuffer[0] = - (uint8_t)(_address >> 8) | 0x01; // set bottom bit high to read - // the 'actual' reg addr is the second byte then - addrbuffer[1] = (uint8_t)(_address & 0xFF); - // the address appears to be a byte longer - return _spidevice->write_then_read(addrbuffer, _addrwidth + 1, buffer, - len); - } - if (_spiregtype == ADDRBIT8_HIGH_TOREAD) { - addrbuffer[0] |= 0x80; - } - if (_spiregtype == ADDRBIT8_HIGH_TOWRITE) { - addrbuffer[0] &= ~0x80; - } - if (_spiregtype == AD8_HIGH_TOREAD_AD7_HIGH_TOINC) { - addrbuffer[0] |= 0x80 | 0x40; - } - return _spidevice->write_then_read(addrbuffer, _addrwidth, buffer, len); - } - return false; -} - -/*! - * @brief Read 2 bytes of data from the register location - * @param value Pointer to uint16_t variable to read into - * @return True on successful write (only really useful for I2C as SPI is - * uncheckable) - */ -bool Adafruit_BusIO_Register::read(uint16_t *value) { - if (!read(_buffer, 2)) { - return false; - } - - if (_byteorder == LSBFIRST) { - *value = _buffer[1]; - *value <<= 8; - *value |= _buffer[0]; - } else { - *value = _buffer[0]; - *value <<= 8; - *value |= _buffer[1]; - } - return true; -} - -/*! - * @brief Read 1 byte of data from the register location - * @param value Pointer to uint8_t variable to read into - * @return True on successful write (only really useful for I2C as SPI is - * uncheckable) - */ -bool Adafruit_BusIO_Register::read(uint8_t *value) { - if (!read(_buffer, 1)) { - return false; - } - - *value = _buffer[0]; - return true; -} - -/*! - * @brief Pretty printer for this register - * @param s The Stream to print to, defaults to &Serial - */ -void Adafruit_BusIO_Register::print(Stream *s) { - uint32_t val = read(); - s->print("0x"); - s->print(val, HEX); -} - -/*! - * @brief Pretty printer for this register - * @param s The Stream to print to, defaults to &Serial - */ -void Adafruit_BusIO_Register::println(Stream *s) { - print(s); - s->println(); -} - -/*! - * @brief Create a slice of the register that we can address without - * touching other bits - * @param reg The Adafruit_BusIO_Register which defines the bus/register - * @param bits The number of bits wide we are slicing - * @param shift The number of bits that our bit-slice is shifted from LSB - */ -Adafruit_BusIO_RegisterBits::Adafruit_BusIO_RegisterBits( - Adafruit_BusIO_Register *reg, uint8_t bits, uint8_t shift) { - _register = reg; - _bits = bits; - _shift = shift; -} - -/*! - * @brief Read 4 bytes of data from the register - * @return data The 4 bytes to read - */ -uint32_t Adafruit_BusIO_RegisterBits::read(void) { - uint32_t val = _register->read(); - val >>= _shift; - return val & ((1 << (_bits)) - 1); -} - -/*! - * @brief Write 4 bytes of data to the register - * @param data The 4 bytes to write - * @return True on successful write (only really useful for I2C as SPI is - * uncheckable) - */ -bool Adafruit_BusIO_RegisterBits::write(uint32_t data) { - uint32_t val = _register->read(); - - // mask off the data before writing - uint32_t mask = (1 << (_bits)) - 1; - data &= mask; - - mask <<= _shift; - val &= ~mask; // remove the current data at that spot - val |= data << _shift; // and add in the new data - - return _register->write(val, _register->width()); -} - -/*! - * @brief The width of the register data, helpful for doing calculations - * @returns The data width used when initializing the register - */ -uint8_t Adafruit_BusIO_Register::width(void) { return _width; } - -/*! - * @brief Set the default width of data - * @param width the default width of data read from register - */ -void Adafruit_BusIO_Register::setWidth(uint8_t width) { _width = width; } - -/*! - * @brief Set register address - * @param address the address from register - */ -void Adafruit_BusIO_Register::setAddress(uint16_t address) { - _address = address; -} - -/*! - * @brief Set the width of register address - * @param address_width the width for register address - */ -void Adafruit_BusIO_Register::setAddressWidth(uint16_t address_width) { - _addrwidth = address_width; -} - -#endif // SPI exists diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_BusIO_Register.h b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_BusIO_Register.h deleted file mode 100644 index c6d58de..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_BusIO_Register.h +++ /dev/null @@ -1,105 +0,0 @@ -#ifndef Adafruit_BusIO_Register_h -#define Adafruit_BusIO_Register_h - -#include - -#if !defined(SPI_INTERFACES_COUNT) || \ - (defined(SPI_INTERFACES_COUNT) && (SPI_INTERFACES_COUNT > 0)) - -#include -#include - -typedef enum _Adafruit_BusIO_SPIRegType { - ADDRBIT8_HIGH_TOREAD = 0, - /*!< - * ADDRBIT8_HIGH_TOREAD - * When reading a register you must actually send the value 0x80 + register - * address to the device. e.g. To read the register 0x0B the register value - * 0x8B is sent and to write 0x0B is sent. - */ - AD8_HIGH_TOREAD_AD7_HIGH_TOINC = 1, - - /*!< - * ADDRBIT8_HIGH_TOWRITE - * When writing to a register you must actually send the value 0x80 + - * the register address to the device. e.g. To write to the register 0x19 the - * register value 0x99 is sent and to read 0x19 is sent. - */ - ADDRBIT8_HIGH_TOWRITE = 2, - - /*!< - * ADDRESSED_OPCODE_LOWBIT_TO_WRITE - * Used by the MCP23S series, we send 0x40 |'rd with the opcode - * Then set the lowest bit to write - */ - ADDRESSED_OPCODE_BIT0_LOW_TO_WRITE = 3, - -} Adafruit_BusIO_SPIRegType; - -/*! - * @brief The class which defines a device register (a location to read/write - * data from) - */ -class Adafruit_BusIO_Register { -public: - Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, uint16_t reg_addr, - uint8_t width = 1, uint8_t byteorder = LSBFIRST, - uint8_t address_width = 1); - - Adafruit_BusIO_Register(Adafruit_SPIDevice *spidevice, uint16_t reg_addr, - Adafruit_BusIO_SPIRegType type, uint8_t width = 1, - uint8_t byteorder = LSBFIRST, - uint8_t address_width = 1); - - Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, - Adafruit_SPIDevice *spidevice, - Adafruit_BusIO_SPIRegType type, uint16_t reg_addr, - uint8_t width = 1, uint8_t byteorder = LSBFIRST, - uint8_t address_width = 1); - - bool read(uint8_t *buffer, uint8_t len); - bool read(uint8_t *value); - bool read(uint16_t *value); - uint32_t read(void); - uint32_t readCached(void); - bool write(uint8_t *buffer, uint8_t len); - bool write(uint32_t value, uint8_t numbytes = 0); - - uint8_t width(void); - - void setWidth(uint8_t width); - void setAddress(uint16_t address); - void setAddressWidth(uint16_t address_width); - - void print(Stream *s = &Serial); - void println(Stream *s = &Serial); - -private: - Adafruit_I2CDevice *_i2cdevice; - Adafruit_SPIDevice *_spidevice; - Adafruit_BusIO_SPIRegType _spiregtype; - uint16_t _address; - uint8_t _width, _addrwidth, _byteorder; - uint8_t _buffer[4]; // we won't support anything larger than uint32 for - // non-buffered read - uint32_t _cached = 0; -}; - -/*! - * @brief The class which defines a slice of bits from within a device register - * (a location to read/write data from) - */ -class Adafruit_BusIO_RegisterBits { -public: - Adafruit_BusIO_RegisterBits(Adafruit_BusIO_Register *reg, uint8_t bits, - uint8_t shift); - bool write(uint32_t value); - uint32_t read(void); - -private: - Adafruit_BusIO_Register *_register; - uint8_t _bits, _shift; -}; - -#endif // SPI exists -#endif // BusIO_Register_h diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CDevice.cpp b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CDevice.cpp deleted file mode 100644 index 92c1731..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CDevice.cpp +++ /dev/null @@ -1,317 +0,0 @@ -#include "Adafruit_I2CDevice.h" - -//#define DEBUG_SERIAL Serial - -/*! - * @brief Create an I2C device at a given address - * @param addr The 7-bit I2C address for the device - * @param theWire The I2C bus to use, defaults to &Wire - */ -Adafruit_I2CDevice::Adafruit_I2CDevice(uint8_t addr, TwoWire *theWire) { - _addr = addr; - _wire = theWire; - _begun = false; -#ifdef ARDUINO_ARCH_SAMD - _maxBufferSize = 250; // as defined in Wire.h's RingBuffer -#elif defined(ESP32) - _maxBufferSize = I2C_BUFFER_LENGTH; -#else - _maxBufferSize = 32; -#endif -} - -/*! - * @brief Initializes and does basic address detection - * @param addr_detect Whether we should attempt to detect the I2C address - * with a scan. 99% of sensors/devices don't mind, but once in a while they - * don't respond well to a scan! - * @return True if I2C initialized and a device with the addr found - */ -bool Adafruit_I2CDevice::begin(bool addr_detect) { - _wire->begin(); - _begun = true; - - if (addr_detect) { - return detected(); - } - return true; -} - -/*! - * @brief De-initialize device, turn off the Wire interface - */ -void Adafruit_I2CDevice::end(void) { - // Not all port implement Wire::end(), such as - // - ESP8266 - // - AVR core without WIRE_HAS_END - // - ESP32: end() is implemented since 2.0.1 which is latest at the moment. - // Temporarily disable for now to give time for user to update. -#if !(defined(ESP8266) || \ - (defined(ARDUINO_ARCH_AVR) && !defined(WIRE_HAS_END)) || \ - defined(ARDUINO_ARCH_ESP32)) - _wire->end(); - _begun = false; -#endif -} - -/*! - * @brief Scans I2C for the address - note will give a false-positive - * if there's no pullups on I2C - * @return True if I2C initialized and a device with the addr found - */ -bool Adafruit_I2CDevice::detected(void) { - // Init I2C if not done yet - if (!_begun && !begin()) { - return false; - } - - // A basic scanner, see if it ACK's - _wire->beginTransmission(_addr); -#ifdef DEBUG_SERIAL - DEBUG_SERIAL.print(F("Address 0x")); - DEBUG_SERIAL.print(_addr); -#endif - if (_wire->endTransmission() == 0) { -#ifdef DEBUG_SERIAL - DEBUG_SERIAL.println(F(" Detected")); -#endif - return true; - } -#ifdef DEBUG_SERIAL - DEBUG_SERIAL.println(F(" Not detected")); -#endif - return false; -} - -/*! - * @brief Write a buffer or two to the I2C device. Cannot be more than - * maxBufferSize() bytes. - * @param buffer Pointer to buffer of data to write. This is const to - * ensure the content of this buffer doesn't change. - * @param len Number of bytes from buffer to write - * @param prefix_buffer Pointer to optional array of data to write before - * buffer. Cannot be more than maxBufferSize() bytes. This is const to - * ensure the content of this buffer doesn't change. - * @param prefix_len Number of bytes from prefix buffer to write - * @param stop Whether to send an I2C STOP signal on write - * @return True if write was successful, otherwise false. - */ -bool Adafruit_I2CDevice::write(const uint8_t *buffer, size_t len, bool stop, - const uint8_t *prefix_buffer, - size_t prefix_len) { - if ((len + prefix_len) > maxBufferSize()) { - // currently not guaranteed to work if more than 32 bytes! - // we will need to find out if some platforms have larger - // I2C buffer sizes :/ -#ifdef DEBUG_SERIAL - DEBUG_SERIAL.println(F("\tI2CDevice could not write such a large buffer")); -#endif - return false; - } - - _wire->beginTransmission(_addr); - - // Write the prefix data (usually an address) - if ((prefix_len != 0) && (prefix_buffer != nullptr)) { - if (_wire->write(prefix_buffer, prefix_len) != prefix_len) { -#ifdef DEBUG_SERIAL - DEBUG_SERIAL.println(F("\tI2CDevice failed to write")); -#endif - return false; - } - } - - // Write the data itself - if (_wire->write(buffer, len) != len) { -#ifdef DEBUG_SERIAL - DEBUG_SERIAL.println(F("\tI2CDevice failed to write")); -#endif - return false; - } - -#ifdef DEBUG_SERIAL - - DEBUG_SERIAL.print(F("\tI2CWRITE @ 0x")); - DEBUG_SERIAL.print(_addr, HEX); - DEBUG_SERIAL.print(F(" :: ")); - if ((prefix_len != 0) && (prefix_buffer != nullptr)) { - for (uint16_t i = 0; i < prefix_len; i++) { - DEBUG_SERIAL.print(F("0x")); - DEBUG_SERIAL.print(prefix_buffer[i], HEX); - DEBUG_SERIAL.print(F(", ")); - } - } - for (uint16_t i = 0; i < len; i++) { - DEBUG_SERIAL.print(F("0x")); - DEBUG_SERIAL.print(buffer[i], HEX); - DEBUG_SERIAL.print(F(", ")); - if (i % 32 == 31) { - DEBUG_SERIAL.println(); - } - } - - if (stop) { - DEBUG_SERIAL.print("\tSTOP"); - } -#endif - - if (_wire->endTransmission(stop) == 0) { -#ifdef DEBUG_SERIAL - DEBUG_SERIAL.println(); - // DEBUG_SERIAL.println("Sent!"); -#endif - return true; - } else { -#ifdef DEBUG_SERIAL - DEBUG_SERIAL.println("\tFailed to send!"); -#endif - return false; - } -} - -/*! - * @brief Read from I2C into a buffer from the I2C device. - * Cannot be more than maxBufferSize() bytes. - * @param buffer Pointer to buffer of data to read into - * @param len Number of bytes from buffer to read. - * @param stop Whether to send an I2C STOP signal on read - * @return True if read was successful, otherwise false. - */ -bool Adafruit_I2CDevice::read(uint8_t *buffer, size_t len, bool stop) { - size_t pos = 0; - while (pos < len) { - size_t read_len = - ((len - pos) > maxBufferSize()) ? maxBufferSize() : (len - pos); - bool read_stop = (pos < (len - read_len)) ? false : stop; - if (!_read(buffer + pos, read_len, read_stop)) - return false; - pos += read_len; - } - return true; -} - -bool Adafruit_I2CDevice::_read(uint8_t *buffer, size_t len, bool stop) { -#if defined(TinyWireM_h) - size_t recv = _wire->requestFrom((uint8_t)_addr, (uint8_t)len); -#elif defined(ARDUINO_ARCH_MEGAAVR) - size_t recv = _wire->requestFrom(_addr, len, stop); -#else - size_t recv = _wire->requestFrom((uint8_t)_addr, (uint8_t)len, (uint8_t)stop); -#endif - - if (recv != len) { - // Not enough data available to fulfill our obligation! -#ifdef DEBUG_SERIAL - DEBUG_SERIAL.print(F("\tI2CDevice did not receive enough data: ")); - DEBUG_SERIAL.println(recv); -#endif - return false; - } - - for (uint16_t i = 0; i < len; i++) { - buffer[i] = _wire->read(); - } - -#ifdef DEBUG_SERIAL - DEBUG_SERIAL.print(F("\tI2CREAD @ 0x")); - DEBUG_SERIAL.print(_addr, HEX); - DEBUG_SERIAL.print(F(" :: ")); - for (uint16_t i = 0; i < len; i++) { - DEBUG_SERIAL.print(F("0x")); - DEBUG_SERIAL.print(buffer[i], HEX); - DEBUG_SERIAL.print(F(", ")); - if (len % 32 == 31) { - DEBUG_SERIAL.println(); - } - } - DEBUG_SERIAL.println(); -#endif - - return true; -} - -/*! - * @brief Write some data, then read some data from I2C into another buffer. - * Cannot be more than maxBufferSize() bytes. The buffers can point to - * same/overlapping locations. - * @param write_buffer Pointer to buffer of data to write from - * @param write_len Number of bytes from buffer to write. - * @param read_buffer Pointer to buffer of data to read into. - * @param read_len Number of bytes from buffer to read. - * @param stop Whether to send an I2C STOP signal between the write and read - * @return True if write & read was successful, otherwise false. - */ -bool Adafruit_I2CDevice::write_then_read(const uint8_t *write_buffer, - size_t write_len, uint8_t *read_buffer, - size_t read_len, bool stop) { - if (!write(write_buffer, write_len, stop)) { - return false; - } - - return read(read_buffer, read_len); -} - -/*! - * @brief Returns the 7-bit address of this device - * @return The 7-bit address of this device - */ -uint8_t Adafruit_I2CDevice::address(void) { return _addr; } - -/*! - * @brief Change the I2C clock speed to desired (relies on - * underlying Wire support! - * @param desiredclk The desired I2C SCL frequency - * @return True if this platform supports changing I2C speed. - * Not necessarily that the speed was achieved! - */ -bool Adafruit_I2CDevice::setSpeed(uint32_t desiredclk) { -#if defined(__AVR_ATmega328__) || \ - defined(__AVR_ATmega328P__) // fix arduino core set clock - // calculate TWBR correctly - - if ((F_CPU / 18) < desiredclk) { -#ifdef DEBUG_SERIAL - Serial.println(F("I2C.setSpeed too high.")); -#endif - return false; - } - uint32_t atwbr = ((F_CPU / desiredclk) - 16) / 2; - if (atwbr > 16320) { -#ifdef DEBUG_SERIAL - Serial.println(F("I2C.setSpeed too low.")); -#endif - return false; - } - - if (atwbr <= 255) { - atwbr /= 1; - TWSR = 0x0; - } else if (atwbr <= 1020) { - atwbr /= 4; - TWSR = 0x1; - } else if (atwbr <= 4080) { - atwbr /= 16; - TWSR = 0x2; - } else { // if (atwbr <= 16320) - atwbr /= 64; - TWSR = 0x3; - } - TWBR = atwbr; - -#ifdef DEBUG_SERIAL - Serial.print(F("TWSR prescaler = ")); - Serial.println(pow(4, TWSR)); - Serial.print(F("TWBR = ")); - Serial.println(atwbr); -#endif - return true; -#elif (ARDUINO >= 157) && !defined(ARDUINO_STM32_FEATHER) && \ - !defined(TinyWireM_h) - _wire->setClock(desiredclk); - return true; - -#else - (void)desiredclk; - return false; -#endif -} diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CDevice.h b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CDevice.h deleted file mode 100644 index 6bda7ba..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CDevice.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef Adafruit_I2CDevice_h -#define Adafruit_I2CDevice_h - -#include -#include - -///< The class which defines how we will talk to this device over I2C -class Adafruit_I2CDevice { -public: - Adafruit_I2CDevice(uint8_t addr, TwoWire *theWire = &Wire); - uint8_t address(void); - bool begin(bool addr_detect = true); - void end(void); - bool detected(void); - - bool read(uint8_t *buffer, size_t len, bool stop = true); - bool write(const uint8_t *buffer, size_t len, bool stop = true, - const uint8_t *prefix_buffer = nullptr, size_t prefix_len = 0); - bool write_then_read(const uint8_t *write_buffer, size_t write_len, - uint8_t *read_buffer, size_t read_len, - bool stop = false); - bool setSpeed(uint32_t desiredclk); - - /*! @brief How many bytes we can read in a transaction - * @return The size of the Wire receive/transmit buffer */ - size_t maxBufferSize() { return _maxBufferSize; } - -private: - uint8_t _addr; - TwoWire *_wire; - bool _begun; - size_t _maxBufferSize; - bool _read(uint8_t *buffer, size_t len, bool stop); -}; - -#endif // Adafruit_I2CDevice_h diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CRegister.h b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CRegister.h deleted file mode 100644 index 186850f..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_I2CRegister.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _ADAFRUIT_I2C_REGISTER_H_ -#define _ADAFRUIT_I2C_REGISTER_H_ - -#include -#include - -typedef Adafruit_BusIO_Register Adafruit_I2CRegister; -typedef Adafruit_BusIO_RegisterBits Adafruit_I2CRegisterBits; - -#endif diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_SPIDevice.cpp b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_SPIDevice.cpp deleted file mode 100644 index 034dc08..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_SPIDevice.cpp +++ /dev/null @@ -1,508 +0,0 @@ -#include "Adafruit_SPIDevice.h" - -//#define DEBUG_SERIAL Serial - -/*! - * @brief Create an SPI device with the given CS pin and settings - * @param cspin The arduino pin number to use for chip select - * @param freq The SPI clock frequency to use, defaults to 1MHz - * @param dataOrder The SPI data order to use for bits within each byte, - * defaults to SPI_BITORDER_MSBFIRST - * @param dataMode The SPI mode to use, defaults to SPI_MODE0 - * @param theSPI The SPI bus to use, defaults to &theSPI - */ -Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t cspin, uint32_t freq, - BusIOBitOrder dataOrder, - uint8_t dataMode, SPIClass *theSPI) { -#ifdef BUSIO_HAS_HW_SPI - _cs = cspin; - _sck = _mosi = _miso = -1; - _spi = theSPI; - _begun = false; - _spiSetting = new SPISettings(freq, dataOrder, dataMode); - _freq = freq; - _dataOrder = dataOrder; - _dataMode = dataMode; -#else - // unused, but needed to suppress compiler warns - (void)cspin; - (void)freq; - (void)dataOrder; - (void)dataMode; - (void)theSPI; -#endif -} - -/*! - * @brief Create an SPI device with the given CS pin and settings - * @param cspin The arduino pin number to use for chip select - * @param sckpin The arduino pin number to use for SCK - * @param misopin The arduino pin number to use for MISO, set to -1 if not - * used - * @param mosipin The arduino pin number to use for MOSI, set to -1 if not - * used - * @param freq The SPI clock frequency to use, defaults to 1MHz - * @param dataOrder The SPI data order to use for bits within each byte, - * defaults to SPI_BITORDER_MSBFIRST - * @param dataMode The SPI mode to use, defaults to SPI_MODE0 - */ -Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t cspin, int8_t sckpin, - int8_t misopin, int8_t mosipin, - uint32_t freq, BusIOBitOrder dataOrder, - uint8_t dataMode) { - _cs = cspin; - _sck = sckpin; - _miso = misopin; - _mosi = mosipin; - -#ifdef BUSIO_USE_FAST_PINIO - csPort = (BusIO_PortReg *)portOutputRegister(digitalPinToPort(cspin)); - csPinMask = digitalPinToBitMask(cspin); - if (mosipin != -1) { - mosiPort = (BusIO_PortReg *)portOutputRegister(digitalPinToPort(mosipin)); - mosiPinMask = digitalPinToBitMask(mosipin); - } - if (misopin != -1) { - misoPort = (BusIO_PortReg *)portInputRegister(digitalPinToPort(misopin)); - misoPinMask = digitalPinToBitMask(misopin); - } - clkPort = (BusIO_PortReg *)portOutputRegister(digitalPinToPort(sckpin)); - clkPinMask = digitalPinToBitMask(sckpin); -#endif - - _freq = freq; - _dataOrder = dataOrder; - _dataMode = dataMode; - _begun = false; -} - -/*! - * @brief Release memory allocated in constructors - */ -Adafruit_SPIDevice::~Adafruit_SPIDevice() { - if (_spiSetting) - delete _spiSetting; -} - -/*! - * @brief Initializes SPI bus and sets CS pin high - * @return Always returns true because there's no way to test success of SPI - * init - */ -bool Adafruit_SPIDevice::begin(void) { - if (_cs != -1) { - pinMode(_cs, OUTPUT); - digitalWrite(_cs, HIGH); - } - - if (_spi) { // hardware SPI -#ifdef BUSIO_HAS_HW_SPI - _spi->begin(); -#endif - } else { - pinMode(_sck, OUTPUT); - - if ((_dataMode == SPI_MODE0) || (_dataMode == SPI_MODE1)) { - // idle low on mode 0 and 1 - digitalWrite(_sck, LOW); - } else { - // idle high on mode 2 or 3 - digitalWrite(_sck, HIGH); - } - if (_mosi != -1) { - pinMode(_mosi, OUTPUT); - digitalWrite(_mosi, HIGH); - } - if (_miso != -1) { - pinMode(_miso, INPUT); - } - } - - _begun = true; - return true; -} - -/*! - * @brief Transfer (send/receive) a buffer over hard/soft SPI, without - * transaction management - * @param buffer The buffer to send and receive at the same time - * @param len The number of bytes to transfer - */ -void Adafruit_SPIDevice::transfer(uint8_t *buffer, size_t len) { - // - // HARDWARE SPI - // - if (_spi) { -#ifdef BUSIO_HAS_HW_SPI -#if defined(SPARK) - _spi->transfer(buffer, buffer, len, nullptr); -#elif defined(STM32) - for (size_t i = 0; i < len; i++) { - _spi->transfer(buffer[i]); - } -#else - _spi->transfer(buffer, len); -#endif - return; -#endif - } - - // - // SOFTWARE SPI - // - uint8_t startbit; - if (_dataOrder == SPI_BITORDER_LSBFIRST) { - startbit = 0x1; - } else { - startbit = 0x80; - } - - bool towrite, lastmosi = !(buffer[0] & startbit); - uint8_t bitdelay_us = (1000000 / _freq) / 2; - - for (size_t i = 0; i < len; i++) { - uint8_t reply = 0; - uint8_t send = buffer[i]; - - /* - Serial.print("\tSending software SPI byte 0x"); - Serial.print(send, HEX); - Serial.print(" -> 0x"); - */ - - // Serial.print(send, HEX); - for (uint8_t b = startbit; b != 0; - b = (_dataOrder == SPI_BITORDER_LSBFIRST) ? b << 1 : b >> 1) { - - if (bitdelay_us) { - delayMicroseconds(bitdelay_us); - } - - if (_dataMode == SPI_MODE0 || _dataMode == SPI_MODE2) { - towrite = send & b; - if ((_mosi != -1) && (lastmosi != towrite)) { -#ifdef BUSIO_USE_FAST_PINIO - if (towrite) - *mosiPort = *mosiPort | mosiPinMask; - else - *mosiPort = *mosiPort & ~mosiPinMask; -#else - digitalWrite(_mosi, towrite); -#endif - lastmosi = towrite; - } - -#ifdef BUSIO_USE_FAST_PINIO - *clkPort = *clkPort | clkPinMask; // Clock high -#else - digitalWrite(_sck, HIGH); -#endif - - if (bitdelay_us) { - delayMicroseconds(bitdelay_us); - } - - if (_miso != -1) { -#ifdef BUSIO_USE_FAST_PINIO - if (*misoPort & misoPinMask) { -#else - if (digitalRead(_miso)) { -#endif - reply |= b; - } - } - -#ifdef BUSIO_USE_FAST_PINIO - *clkPort = *clkPort & ~clkPinMask; // Clock low -#else - digitalWrite(_sck, LOW); -#endif - } else { // if (_dataMode == SPI_MODE1 || _dataMode == SPI_MODE3) - -#ifdef BUSIO_USE_FAST_PINIO - *clkPort = *clkPort | clkPinMask; // Clock high -#else - digitalWrite(_sck, HIGH); -#endif - - if (bitdelay_us) { - delayMicroseconds(bitdelay_us); - } - - if (_mosi != -1) { -#ifdef BUSIO_USE_FAST_PINIO - if (send & b) - *mosiPort = *mosiPort | mosiPinMask; - else - *mosiPort = *mosiPort & ~mosiPinMask; -#else - digitalWrite(_mosi, send & b); -#endif - } - -#ifdef BUSIO_USE_FAST_PINIO - *clkPort = *clkPort & ~clkPinMask; // Clock low -#else - digitalWrite(_sck, LOW); -#endif - - if (_miso != -1) { -#ifdef BUSIO_USE_FAST_PINIO - if (*misoPort & misoPinMask) { -#else - if (digitalRead(_miso)) { -#endif - reply |= b; - } - } - } - if (_miso != -1) { - buffer[i] = reply; - } - } - } - return; -} - -/*! - * @brief Transfer (send/receive) one byte over hard/soft SPI, without - * transaction management - * @param send The byte to send - * @return The byte received while transmitting - */ -uint8_t Adafruit_SPIDevice::transfer(uint8_t send) { - uint8_t data = send; - transfer(&data, 1); - return data; -} - -/*! - * @brief Manually begin a transaction (calls beginTransaction if hardware - * SPI) - */ -void Adafruit_SPIDevice::beginTransaction(void) { - if (_spi) { -#ifdef BUSIO_HAS_HW_SPI - _spi->beginTransaction(*_spiSetting); -#endif - } -} - -/*! - * @brief Manually end a transaction (calls endTransaction if hardware SPI) - */ -void Adafruit_SPIDevice::endTransaction(void) { - if (_spi) { -#ifdef BUSIO_HAS_HW_SPI - _spi->endTransaction(); -#endif - } -} - -/*! - * @brief Assert/Deassert the CS pin if it is defined - * @param value The state the CS is set to - */ -void Adafruit_SPIDevice::setChipSelect(int value) { - if (_cs != -1) { - digitalWrite(_cs, value); - } -} - -/*! - * @brief Write a buffer or two to the SPI device, with transaction - * management. - * @brief Manually begin a transaction (calls beginTransaction if hardware - * SPI) with asserting the CS pin - */ -void Adafruit_SPIDevice::beginTransactionWithAssertingCS() { - beginTransaction(); - setChipSelect(LOW); -} - -/*! - * @brief Manually end a transaction (calls endTransaction if hardware SPI) - * with deasserting the CS pin - */ -void Adafruit_SPIDevice::endTransactionWithDeassertingCS() { - setChipSelect(HIGH); - endTransaction(); -} - -/*! - * @brief Write a buffer or two to the SPI device, with transaction - * management. - * @param buffer Pointer to buffer of data to write - * @param len Number of bytes from buffer to write - * @param prefix_buffer Pointer to optional array of data to write before - * buffer. - * @param prefix_len Number of bytes from prefix buffer to write - * @return Always returns true because there's no way to test success of SPI - * writes - */ -bool Adafruit_SPIDevice::write(const uint8_t *buffer, size_t len, - const uint8_t *prefix_buffer, - size_t prefix_len) { - beginTransactionWithAssertingCS(); - - // do the writing -#if defined(ARDUINO_ARCH_ESP32) - if (_spi) { - if (prefix_len > 0) { - _spi->transferBytes((uint8_t *)prefix_buffer, nullptr, prefix_len); - } - if (len > 0) { - _spi->transferBytes((uint8_t *)buffer, nullptr, len); - } - } else -#endif - { - for (size_t i = 0; i < prefix_len; i++) { - transfer(prefix_buffer[i]); - } - for (size_t i = 0; i < len; i++) { - transfer(buffer[i]); - } - } - endTransactionWithDeassertingCS(); - -#ifdef DEBUG_SERIAL - DEBUG_SERIAL.print(F("\tSPIDevice Wrote: ")); - if ((prefix_len != 0) && (prefix_buffer != nullptr)) { - for (uint16_t i = 0; i < prefix_len; i++) { - DEBUG_SERIAL.print(F("0x")); - DEBUG_SERIAL.print(prefix_buffer[i], HEX); - DEBUG_SERIAL.print(F(", ")); - } - } - for (uint16_t i = 0; i < len; i++) { - DEBUG_SERIAL.print(F("0x")); - DEBUG_SERIAL.print(buffer[i], HEX); - DEBUG_SERIAL.print(F(", ")); - if (i % 32 == 31) { - DEBUG_SERIAL.println(); - } - } - DEBUG_SERIAL.println(); -#endif - - return true; -} - -/*! - * @brief Read from SPI into a buffer from the SPI device, with transaction - * management. - * @param buffer Pointer to buffer of data to read into - * @param len Number of bytes from buffer to read. - * @param sendvalue The 8-bits of data to write when doing the data read, - * defaults to 0xFF - * @return Always returns true because there's no way to test success of SPI - * writes - */ -bool Adafruit_SPIDevice::read(uint8_t *buffer, size_t len, uint8_t sendvalue) { - memset(buffer, sendvalue, len); // clear out existing buffer - - beginTransactionWithAssertingCS(); - transfer(buffer, len); - endTransactionWithDeassertingCS(); - -#ifdef DEBUG_SERIAL - DEBUG_SERIAL.print(F("\tSPIDevice Read: ")); - for (uint16_t i = 0; i < len; i++) { - DEBUG_SERIAL.print(F("0x")); - DEBUG_SERIAL.print(buffer[i], HEX); - DEBUG_SERIAL.print(F(", ")); - if (len % 32 == 31) { - DEBUG_SERIAL.println(); - } - } - DEBUG_SERIAL.println(); -#endif - - return true; -} - -/*! - * @brief Write some data, then read some data from SPI into another buffer, - * with transaction management. The buffers can point to same/overlapping - * locations. This does not transmit-receive at the same time! - * @param write_buffer Pointer to buffer of data to write from - * @param write_len Number of bytes from buffer to write. - * @param read_buffer Pointer to buffer of data to read into. - * @param read_len Number of bytes from buffer to read. - * @param sendvalue The 8-bits of data to write when doing the data read, - * defaults to 0xFF - * @return Always returns true because there's no way to test success of SPI - * writes - */ -bool Adafruit_SPIDevice::write_then_read(const uint8_t *write_buffer, - size_t write_len, uint8_t *read_buffer, - size_t read_len, uint8_t sendvalue) { - beginTransactionWithAssertingCS(); - // do the writing -#if defined(ARDUINO_ARCH_ESP32) - if (_spi) { - if (write_len > 0) { - _spi->transferBytes((uint8_t *)write_buffer, nullptr, write_len); - } - } else -#endif - { - for (size_t i = 0; i < write_len; i++) { - transfer(write_buffer[i]); - } - } - -#ifdef DEBUG_SERIAL - DEBUG_SERIAL.print(F("\tSPIDevice Wrote: ")); - for (uint16_t i = 0; i < write_len; i++) { - DEBUG_SERIAL.print(F("0x")); - DEBUG_SERIAL.print(write_buffer[i], HEX); - DEBUG_SERIAL.print(F(", ")); - if (write_len % 32 == 31) { - DEBUG_SERIAL.println(); - } - } - DEBUG_SERIAL.println(); -#endif - - // do the reading - for (size_t i = 0; i < read_len; i++) { - read_buffer[i] = transfer(sendvalue); - } - -#ifdef DEBUG_SERIAL - DEBUG_SERIAL.print(F("\tSPIDevice Read: ")); - for (uint16_t i = 0; i < read_len; i++) { - DEBUG_SERIAL.print(F("0x")); - DEBUG_SERIAL.print(read_buffer[i], HEX); - DEBUG_SERIAL.print(F(", ")); - if (read_len % 32 == 31) { - DEBUG_SERIAL.println(); - } - } - DEBUG_SERIAL.println(); -#endif - - endTransactionWithDeassertingCS(); - - return true; -} - -/*! - * @brief Write some data and read some data at the same time from SPI - * into the same buffer, with transaction management. This is basicaly a wrapper - * for transfer() with CS-pin and transaction management. This /does/ - * transmit-receive at the same time! - * @param buffer Pointer to buffer of data to write/read to/from - * @param len Number of bytes from buffer to write/read. - * @return Always returns true because there's no way to test success of SPI - * writes - */ -bool Adafruit_SPIDevice::write_and_read(uint8_t *buffer, size_t len) { - beginTransactionWithAssertingCS(); - transfer(buffer, len); - endTransactionWithDeassertingCS(); - - return true; -} diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_SPIDevice.h b/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_SPIDevice.h deleted file mode 100644 index 74123b9..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/Adafruit_SPIDevice.h +++ /dev/null @@ -1,142 +0,0 @@ -#ifndef Adafruit_SPIDevice_h -#define Adafruit_SPIDevice_h - -#include - -#if !defined(SPI_INTERFACES_COUNT) || \ - (defined(SPI_INTERFACES_COUNT) && (SPI_INTERFACES_COUNT > 0)) -// HW SPI available -#include -#define BUSIO_HAS_HW_SPI -#else -// SW SPI ONLY -enum { SPI_MODE0, SPI_MODE1, SPI_MODE2, _SPI_MODE4 }; -typedef uint8_t SPIClass; -#endif - -// some modern SPI definitions don't have BitOrder enum -#if (defined(__AVR__) && !defined(ARDUINO_ARCH_MEGAAVR)) || \ - defined(ESP8266) || defined(TEENSYDUINO) || defined(SPARK) || \ - defined(ARDUINO_ARCH_SPRESENSE) || defined(MEGATINYCORE) || \ - defined(DXCORE) || defined(ARDUINO_AVR_ATmega4809) || \ - defined(ARDUINO_AVR_ATmega4808) || defined(ARDUINO_AVR_ATmega3209) || \ - defined(ARDUINO_AVR_ATmega3208) || defined(ARDUINO_AVR_ATmega1609) || \ - defined(ARDUINO_AVR_ATmega1608) || defined(ARDUINO_AVR_ATmega809) || \ - defined(ARDUINO_AVR_ATmega808) || defined(ARDUINO_ARCH_ARC32) || \ - defined(ARDUINO_ARCH_XMC) - -typedef enum _BitOrder { - SPI_BITORDER_MSBFIRST = MSBFIRST, - SPI_BITORDER_LSBFIRST = LSBFIRST, -} BusIOBitOrder; - -#elif defined(ESP32) || defined(__ASR6501__) || defined(__ASR6502__) - -// some modern SPI definitions don't have BitOrder enum and have different SPI -// mode defines -typedef enum _BitOrder { - SPI_BITORDER_MSBFIRST = SPI_MSBFIRST, - SPI_BITORDER_LSBFIRST = SPI_LSBFIRST, -} BusIOBitOrder; - -#else -// Some platforms have a BitOrder enum but its named MSBFIRST/LSBFIRST -#define SPI_BITORDER_MSBFIRST MSBFIRST -#define SPI_BITORDER_LSBFIRST LSBFIRST -typedef BitOrder BusIOBitOrder; -#endif - -#if defined(__IMXRT1062__) // Teensy 4.x -// *Warning* I disabled the usage of FAST_PINIO as the set/clear operations -// used in the cpp file are not atomic and can effect multiple IO pins -// and if an interrupt happens in between the time the code reads the register -// and writes out the updated value, that changes one or more other IO pins -// on that same IO port, those change will be clobbered when the updated -// values are written back. A fast version can be implemented that uses the -// ports set and clear registers which are atomic. -// typedef volatile uint32_t BusIO_PortReg; -// typedef uint32_t BusIO_PortMask; -//#define BUSIO_USE_FAST_PINIO - -#elif defined(ARDUINO_ARCH_XMC) -#undef BUSIO_USE_FAST_PINIO - -#elif defined(__AVR__) || defined(TEENSYDUINO) -typedef volatile uint8_t BusIO_PortReg; -typedef uint8_t BusIO_PortMask; -#define BUSIO_USE_FAST_PINIO - -#elif defined(ESP8266) || defined(ESP32) || defined(__SAM3X8E__) || \ - defined(ARDUINO_ARCH_SAMD) -typedef volatile uint32_t BusIO_PortReg; -typedef uint32_t BusIO_PortMask; -#define BUSIO_USE_FAST_PINIO - -#elif (defined(__arm__) || defined(ARDUINO_FEATHER52)) && \ - !defined(ARDUINO_ARCH_MBED) && !defined(ARDUINO_ARCH_RP2040) -typedef volatile uint32_t BusIO_PortReg; -typedef uint32_t BusIO_PortMask; -#if !defined(__ASR6501__) && !defined(__ASR6502__) -#define BUSIO_USE_FAST_PINIO -#endif - -#else -#undef BUSIO_USE_FAST_PINIO -#endif - -/**! The class which defines how we will talk to this device over SPI **/ -class Adafruit_SPIDevice { -public: -#ifdef BUSIO_HAS_HW_SPI - Adafruit_SPIDevice(int8_t cspin, uint32_t freq = 1000000, - BusIOBitOrder dataOrder = SPI_BITORDER_MSBFIRST, - uint8_t dataMode = SPI_MODE0, SPIClass *theSPI = &SPI); -#else - Adafruit_SPIDevice(int8_t cspin, uint32_t freq = 1000000, - BusIOBitOrder dataOrder = SPI_BITORDER_MSBFIRST, - uint8_t dataMode = SPI_MODE0, SPIClass *theSPI = nullptr); -#endif - Adafruit_SPIDevice(int8_t cspin, int8_t sck, int8_t miso, int8_t mosi, - uint32_t freq = 1000000, - BusIOBitOrder dataOrder = SPI_BITORDER_MSBFIRST, - uint8_t dataMode = SPI_MODE0); - ~Adafruit_SPIDevice(); - - bool begin(void); - bool read(uint8_t *buffer, size_t len, uint8_t sendvalue = 0xFF); - bool write(const uint8_t *buffer, size_t len, - const uint8_t *prefix_buffer = nullptr, size_t prefix_len = 0); - bool write_then_read(const uint8_t *write_buffer, size_t write_len, - uint8_t *read_buffer, size_t read_len, - uint8_t sendvalue = 0xFF); - bool write_and_read(uint8_t *buffer, size_t len); - - uint8_t transfer(uint8_t send); - void transfer(uint8_t *buffer, size_t len); - void beginTransaction(void); - void endTransaction(void); - void beginTransactionWithAssertingCS(); - void endTransactionWithDeassertingCS(); - -private: -#ifdef BUSIO_HAS_HW_SPI - SPIClass *_spi = nullptr; - SPISettings *_spiSetting = nullptr; -#else - uint8_t *_spi = nullptr; - uint8_t *_spiSetting = nullptr; -#endif - uint32_t _freq; - BusIOBitOrder _dataOrder; - uint8_t _dataMode; - void setChipSelect(int value); - - int8_t _cs, _sck, _mosi, _miso; -#ifdef BUSIO_USE_FAST_PINIO - BusIO_PortReg *mosiPort, *clkPort, *misoPort, *csPort; - BusIO_PortMask mosiPinMask, misoPinMask, clkPinMask, csPinMask; -#endif - bool _begun; -}; - -#endif // Adafruit_SPIDevice_h diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/CMakeLists.txt b/.pio/libdeps/teensy41/Adafruit BusIO/CMakeLists.txt deleted file mode 100644 index 880b1aa..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -# Adafruit Bus IO Library -# https://github.com/adafruit/Adafruit_BusIO -# MIT License - -cmake_minimum_required(VERSION 3.5) - -idf_component_register(SRCS "Adafruit_I2CDevice.cpp" "Adafruit_BusIO_Register.cpp" "Adafruit_SPIDevice.cpp" - INCLUDE_DIRS "." - REQUIRES arduino) - -project(Adafruit_BusIO) diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/LICENSE b/.pio/libdeps/teensy41/Adafruit BusIO/LICENSE deleted file mode 100644 index 860e3e2..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2017 Adafruit Industries - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/README.md b/.pio/libdeps/teensy41/Adafruit BusIO/README.md deleted file mode 100644 index 1cc06a1..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Adafruit Bus IO Library [![Build Status](https://github.com/adafruit/Adafruit_BusIO/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_BusIO/actions) - - -This is a helper library to abstract away I2C & SPI transactions and registers - -Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! - -MIT license, all text above must be included in any redistribution diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/component.mk b/.pio/libdeps/teensy41/Adafruit BusIO/component.mk deleted file mode 100644 index 049f190..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/component.mk +++ /dev/null @@ -1 +0,0 @@ -COMPONENT_ADD_INCLUDEDIRS = . diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_address_detect/i2c_address_detect.ino b/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_address_detect/i2c_address_detect.ino deleted file mode 100644 index b150525..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_address_detect/i2c_address_detect.ino +++ /dev/null @@ -1,21 +0,0 @@ -#include - -Adafruit_I2CDevice i2c_dev = Adafruit_I2CDevice(0x10); - -void setup() { - while (!Serial) { delay(10); } - Serial.begin(115200); - Serial.println("I2C address detection test"); - - if (!i2c_dev.begin()) { - Serial.print("Did not find device at 0x"); - Serial.println(i2c_dev.address(), HEX); - while (1); - } - Serial.print("Device found on address 0x"); - Serial.println(i2c_dev.address(), HEX); -} - -void loop() { - -} diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_readwrite/i2c_readwrite.ino b/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_readwrite/i2c_readwrite.ino deleted file mode 100644 index 909cf31..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_readwrite/i2c_readwrite.ino +++ /dev/null @@ -1,41 +0,0 @@ -#include - -#define I2C_ADDRESS 0x60 -Adafruit_I2CDevice i2c_dev = Adafruit_I2CDevice(I2C_ADDRESS); - - -void setup() { - while (!Serial) { delay(10); } - Serial.begin(115200); - Serial.println("I2C device read and write test"); - - if (!i2c_dev.begin()) { - Serial.print("Did not find device at 0x"); - Serial.println(i2c_dev.address(), HEX); - while (1); - } - Serial.print("Device found on address 0x"); - Serial.println(i2c_dev.address(), HEX); - - uint8_t buffer[32]; - // Try to read 32 bytes - i2c_dev.read(buffer, 32); - Serial.print("Read: "); - for (uint8_t i=0; i<32; i++) { - Serial.print("0x"); Serial.print(buffer[i], HEX); Serial.print(", "); - } - Serial.println(); - - // read a register by writing first, then reading - buffer[0] = 0x0C; // we'll reuse the same buffer - i2c_dev.write_then_read(buffer, 1, buffer, 2, false); - Serial.print("Write then Read: "); - for (uint8_t i=0; i<2; i++) { - Serial.print("0x"); Serial.print(buffer[i], HEX); Serial.print(", "); - } - Serial.println(); -} - -void loop() { - -} diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_registers/i2c_registers.ino b/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_registers/i2c_registers.ino deleted file mode 100644 index 41a3043..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2c_registers/i2c_registers.ino +++ /dev/null @@ -1,38 +0,0 @@ -#include -#include - -#define I2C_ADDRESS 0x60 -Adafruit_I2CDevice i2c_dev = Adafruit_I2CDevice(I2C_ADDRESS); - - -void setup() { - while (!Serial) { delay(10); } - Serial.begin(115200); - Serial.println("I2C device register test"); - - if (!i2c_dev.begin()) { - Serial.print("Did not find device at 0x"); - Serial.println(i2c_dev.address(), HEX); - while (1); - } - Serial.print("Device found on address 0x"); - Serial.println(i2c_dev.address(), HEX); - - Adafruit_BusIO_Register id_reg = Adafruit_BusIO_Register(&i2c_dev, 0x0C, 2, LSBFIRST); - uint16_t id; - id_reg.read(&id); - Serial.print("ID register = 0x"); Serial.println(id, HEX); - - Adafruit_BusIO_Register thresh_reg = Adafruit_BusIO_Register(&i2c_dev, 0x01, 2, LSBFIRST); - uint16_t thresh; - thresh_reg.read(&thresh); - Serial.print("Initial threshold register = 0x"); Serial.println(thresh, HEX); - - thresh_reg.write(~thresh); - - Serial.print("Post threshold register = 0x"); Serial.println(thresh_reg.read(), HEX); -} - -void loop() { - -} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2corspi_register/i2corspi_register.ino b/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2corspi_register/i2corspi_register.ino deleted file mode 100644 index 992a2e0..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/examples/i2corspi_register/i2corspi_register.ino +++ /dev/null @@ -1,38 +0,0 @@ -#include - -// Define which interface to use by setting the unused interface to NULL! - -#define SPIDEVICE_CS 10 -Adafruit_SPIDevice *spi_dev = NULL; // new Adafruit_SPIDevice(SPIDEVICE_CS); - -#define I2C_ADDRESS 0x5D -Adafruit_I2CDevice *i2c_dev = new Adafruit_I2CDevice(I2C_ADDRESS); - -void setup() { - while (!Serial) { delay(10); } - Serial.begin(115200); - Serial.println("I2C or SPI device register test"); - - if (spi_dev && !spi_dev->begin()) { - Serial.println("Could not initialize SPI device"); - } - - if (i2c_dev) { - if (i2c_dev->begin()) { - Serial.print("Device found on I2C address 0x"); - Serial.println(i2c_dev->address(), HEX); - } else { - Serial.print("Did not find I2C device at 0x"); - Serial.println(i2c_dev->address(), HEX); - } - } - - Adafruit_BusIO_Register id_reg = Adafruit_BusIO_Register(i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, 0x0F); - uint8_t id=0; - id_reg.read(&id); - Serial.print("ID register = 0x"); Serial.println(id, HEX); -} - -void loop() { - -} diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_modetest/spi_modetest.ino b/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_modetest/spi_modetest.ino deleted file mode 100644 index 10168c5..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_modetest/spi_modetest.ino +++ /dev/null @@ -1,29 +0,0 @@ -#include - -#define SPIDEVICE_CS 10 -Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice(SPIDEVICE_CS, 100000, SPI_BITORDER_MSBFIRST, SPI_MODE1); -//Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice(SPIDEVICE_CS, 13, 12, 11, 100000, SPI_BITORDER_MSBFIRST, SPI_MODE1); - - -void setup() { - while (!Serial) { delay(10); } - Serial.begin(115200); - Serial.println("SPI device mode test"); - - if (!spi_dev.begin()) { - Serial.println("Could not initialize SPI device"); - while (1); - } -} - -void loop() { - Serial.println("\n\nTransfer test"); - for (uint16_t x=0; x<=0xFF; x++) { - uint8_t i = x; - Serial.print("0x"); Serial.print(i, HEX); - spi_dev.read(&i, 1, i); - Serial.print("/"); Serial.print(i, HEX); - Serial.print(", "); - delay(25); - } -} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_readwrite/spi_readwrite.ino b/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_readwrite/spi_readwrite.ino deleted file mode 100644 index 6f2c063..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_readwrite/spi_readwrite.ino +++ /dev/null @@ -1,39 +0,0 @@ -#include - -#define SPIDEVICE_CS 10 -Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice(SPIDEVICE_CS); - - -void setup() { - while (!Serial) { delay(10); } - Serial.begin(115200); - Serial.println("SPI device read and write test"); - - if (!spi_dev.begin()) { - Serial.println("Could not initialize SPI device"); - while (1); - } - - uint8_t buffer[32]; - - // Try to read 32 bytes - spi_dev.read(buffer, 32); - Serial.print("Read: "); - for (uint8_t i=0; i<32; i++) { - Serial.print("0x"); Serial.print(buffer[i], HEX); Serial.print(", "); - } - Serial.println(); - - // read a register by writing first, then reading - buffer[0] = 0x8F; // we'll reuse the same buffer - spi_dev.write_then_read(buffer, 1, buffer, 2, false); - Serial.print("Write then Read: "); - for (uint8_t i=0; i<2; i++) { - Serial.print("0x"); Serial.print(buffer[i], HEX); Serial.print(", "); - } - Serial.println(); -} - -void loop() { - -} diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_register_bits/spi_register_bits.ino b/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_register_bits/spi_register_bits.ino deleted file mode 100644 index e70a17b..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_register_bits/spi_register_bits.ino +++ /dev/null @@ -1,192 +0,0 @@ -/*************************************************** - - This is an example for how to use Adafruit_BusIO_RegisterBits from Adafruit_BusIO library. - - Designed specifically to work with the Adafruit RTD Sensor - ----> https://www.adafruit.com/products/3328 - uisng a MAX31865 RTD-to-Digital Converter - ----> https://datasheets.maximintegrated.com/en/ds/MAX31865.pdf - - This sensor uses SPI to communicate, 4 pins are required to - interface. - A fifth pin helps to detect when a new conversion is ready. - - Adafruit invests time and resources providing this open source code, - please support Adafruit and open-source hardware by purchasing - products from Adafruit! - - Example written (2020/3) by Andreas Hardtung/AnHard. - BSD license, all text above must be included in any redistribution - ****************************************************/ - -#include -#include - -#define MAX31865_SPI_SPEED (5000000) -#define MAX31865_SPI_BITORDER (SPI_BITORDER_MSBFIRST) -#define MAX31865_SPI_MODE (SPI_MODE1) - -#define MAX31865_SPI_CS (10) -#define MAX31865_READY_PIN (2) - - -Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice( MAX31865_SPI_CS, MAX31865_SPI_SPEED, MAX31865_SPI_BITORDER, MAX31865_SPI_MODE, &SPI); // Hardware SPI -// Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice( MAX31865_SPI_CS, 13, 12, 11, MAX31865_SPI_SPEED, MAX31865_SPI_BITORDER, MAX31865_SPI_MODE); // Software SPI - -// MAX31865 chip related ********************************************************************************************* -Adafruit_BusIO_Register config_reg = Adafruit_BusIO_Register(&spi_dev, 0x00, ADDRBIT8_HIGH_TOWRITE, 1, MSBFIRST); -Adafruit_BusIO_RegisterBits bias_bit = Adafruit_BusIO_RegisterBits(&config_reg, 1, 7); -Adafruit_BusIO_RegisterBits auto_bit = Adafruit_BusIO_RegisterBits(&config_reg, 1, 6); -Adafruit_BusIO_RegisterBits oneS_bit = Adafruit_BusIO_RegisterBits(&config_reg, 1, 5); -Adafruit_BusIO_RegisterBits wire_bit = Adafruit_BusIO_RegisterBits(&config_reg, 1, 4); -Adafruit_BusIO_RegisterBits faultT_bits = Adafruit_BusIO_RegisterBits(&config_reg, 2, 2); -Adafruit_BusIO_RegisterBits faultR_bit = Adafruit_BusIO_RegisterBits(&config_reg, 1, 1); -Adafruit_BusIO_RegisterBits fi50hz_bit = Adafruit_BusIO_RegisterBits(&config_reg, 1, 0); - -Adafruit_BusIO_Register rRatio_reg = Adafruit_BusIO_Register(&spi_dev, 0x01, ADDRBIT8_HIGH_TOWRITE, 2, MSBFIRST); -Adafruit_BusIO_RegisterBits rRatio_bits = Adafruit_BusIO_RegisterBits(&rRatio_reg, 15, 1); -Adafruit_BusIO_RegisterBits fault_bit = Adafruit_BusIO_RegisterBits(&rRatio_reg, 1, 0); - -Adafruit_BusIO_Register maxRratio_reg = Adafruit_BusIO_Register(&spi_dev, 0x03, ADDRBIT8_HIGH_TOWRITE, 2, MSBFIRST); -Adafruit_BusIO_RegisterBits maxRratio_bits = Adafruit_BusIO_RegisterBits(&maxRratio_reg, 15, 1); - -Adafruit_BusIO_Register minRratio_reg = Adafruit_BusIO_Register(&spi_dev, 0x05, ADDRBIT8_HIGH_TOWRITE, 2, MSBFIRST); -Adafruit_BusIO_RegisterBits minRratio_bits = Adafruit_BusIO_RegisterBits(&minRratio_reg, 15, 1); - -Adafruit_BusIO_Register fault_reg = Adafruit_BusIO_Register(&spi_dev, 0x07, ADDRBIT8_HIGH_TOWRITE, 1, MSBFIRST); -Adafruit_BusIO_RegisterBits range_high_fault_bit = Adafruit_BusIO_RegisterBits(&fault_reg, 1, 7); -Adafruit_BusIO_RegisterBits range_low_fault_bit = Adafruit_BusIO_RegisterBits(&fault_reg, 1, 6); -Adafruit_BusIO_RegisterBits refin_high_fault_bit = Adafruit_BusIO_RegisterBits(&fault_reg, 1, 5); -Adafruit_BusIO_RegisterBits refin_low_fault_bit = Adafruit_BusIO_RegisterBits(&fault_reg, 1, 4); -Adafruit_BusIO_RegisterBits rtdin_low_fault_bit = Adafruit_BusIO_RegisterBits(&fault_reg, 1, 3); -Adafruit_BusIO_RegisterBits voltage_fault_bit = Adafruit_BusIO_RegisterBits(&fault_reg, 1, 2); - -// Print the details of the configuration register. -void printConfig( void ) { - Serial.print("BIAS: "); if (bias_bit.read() ) Serial.print("ON"); else Serial.print("OFF"); - Serial.print(", AUTO: "); if (auto_bit.read() ) Serial.print("ON"); else Serial.print("OFF"); - Serial.print(", ONES: "); if (oneS_bit.read() ) Serial.print("ON"); else Serial.print("OFF"); - Serial.print(", WIRE: "); if (wire_bit.read() ) Serial.print("3"); else Serial.print("2/4"); - Serial.print(", FAULTCLEAR: "); if (faultR_bit.read() ) Serial.print("ON"); else Serial.print("OFF"); - Serial.print(", "); if (fi50hz_bit.read() ) Serial.print("50HZ"); else Serial.print("60HZ"); - Serial.println(); -} - -// Check and print faults. Then clear them. -void checkFaults( void ) { - if (fault_bit.read()) { - Serial.print("MAX: "); Serial.println(maxRratio_bits.read()); - Serial.print("VAL: "); Serial.println( rRatio_bits.read()); - Serial.print("MIN: "); Serial.println(minRratio_bits.read()); - - if (range_high_fault_bit.read() ) Serial.println("Range high fault"); - if ( range_low_fault_bit.read() ) Serial.println("Range low fault"); - if (refin_high_fault_bit.read() ) Serial.println("REFIN high fault"); - if ( refin_low_fault_bit.read() ) Serial.println("REFIN low fault"); - if ( rtdin_low_fault_bit.read() ) Serial.println("RTDIN low fault"); - if ( voltage_fault_bit.read() ) Serial.println("Voltage fault"); - - faultR_bit.write(1); // clear fault - } -} - -void setup() { - #if (MAX31865_1_READY_PIN != -1) - pinMode(MAX31865_READY_PIN ,INPUT_PULLUP); - #endif - - while (!Serial) { delay(10); } - Serial.begin(115200); - Serial.println("SPI Adafruit_BusIO_RegisterBits test on MAX31865"); - - if (!spi_dev.begin()) { - Serial.println("Could not initialize SPI device"); - while (1); - } - - // Set up for automode 50Hz. We don't care about selfheating. We want the highest possible sampling rate. - auto_bit.write(0); // Don't switch filtermode while auto_mode is on. - fi50hz_bit.write(1); // Set filter to 50Hz mode. - faultR_bit.write(1); // Clear faults. - bias_bit.write(1); // In automode we want to have the bias current always on. - delay(5); // Wait until bias current settles down. - // 10.5 time constants of the input RC network is required. - // 10ms worst case for 10kω reference resistor and a 0.1µF capacitor across the RTD inputs. - // Adafruit Module has 0.1µF and only 430/4300ω So here 0.43/4.3ms - auto_bit.write(1); // Now we can set automode. Automatically starting first conversion. - - // Test the READY_PIN - #if (defined( MAX31865_READY_PIN ) && (MAX31865_READY_PIN != -1)) - int i = 0; - while (digitalRead(MAX31865_READY_PIN) && i++ <= 100) { delay(1); } - if (i >= 100) { - Serial.print("ERROR: Max31865 Pin detection does not work. PIN:"); - Serial.println(MAX31865_READY_PIN); - } - #else - delay(100); - #endif - - // Set ratio range. - // Setting the temperatures would need some more calculation - not related to Adafruit_BusIO_RegisterBits. - uint16_t ratio = rRatio_bits.read(); - maxRratio_bits.write( (ratio < 0x8fffu-1000u) ? ratio + 1000u : 0x8fffu ); - minRratio_bits.write( (ratio > 1000u) ? ratio - 1000u : 0u ); - - printConfig(); - checkFaults(); -} - -void loop() { - #if (defined( MAX31865_READY_PIN ) && (MAX31865_1_READY_PIN != -1)) - // Is conversion ready? - if (!digitalRead(MAX31865_READY_PIN)) - #else - // Warant conversion is ready. - delay(21); // 21ms for 50Hz-mode. 19ms in 60Hz-mode. - #endif - { - // Read ratio, calculate temperature, scale, filter and print. - Serial.println( rRatio2C( rRatio_bits.read() ) * 100.0f, 0); // Temperature scaled by 100 - // Check, print, clear faults. - checkFaults(); - } - - // Do something else. - //delay(15000); -} - - -// Module/Sensor related. Here Adafruit PT100 module with a 2_Wire PT100 Class C ***************************** -float rRatio2C(uint16_t ratio) { - // A simple linear conversion. - const float R0 = 100.0f; - const float Rref = 430.0f; - const float alphaPT = 0.003850f; - const float ADCmax = (1u << 15) - 1.0f; - const float rscale = Rref / ADCmax; - // Measured temperature in boiling water 101.08°C with factor a = 1 and b = 0. Rref and MAX at about 22±2°C. - // Measured temperature in ice/water bath 0.76°C with factor a = 1 and b = 0. Rref and MAX at about 22±2°C. - //const float a = 1.0f / (alphaPT * R0); - const float a = (100.0f/101.08f) / (alphaPT * R0); - //const float b = 0.0f; // 101.08 - const float b = -0.76f; // 100.32 > 101.08 - - return filterRing( ((ratio * rscale) - R0) * a + b ); -} - -// General purpose ********************************************************************************************* -#define RINGLENGTH 250 -float filterRing( float newVal ) { - static float ring[RINGLENGTH] = { 0.0 }; - static uint8_t ringIndex = 0; - static bool ringFull = false; - - if ( ringIndex == RINGLENGTH ) { ringFull = true; ringIndex = 0; } - ring[ringIndex] = newVal; - uint8_t loopEnd = (ringFull) ? RINGLENGTH : ringIndex + 1; - float ringSum = 0.0f; - for (uint8_t i = 0; i < loopEnd; i++) ringSum += ring[i]; - ringIndex++; - return ringSum / loopEnd; -} diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_registers/spi_registers.ino b/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_registers/spi_registers.ino deleted file mode 100644 index 091a353..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/examples/spi_registers/spi_registers.ino +++ /dev/null @@ -1,34 +0,0 @@ -#include -#include - -#define SPIDEVICE_CS 10 -Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice(SPIDEVICE_CS); - -void setup() { - while (!Serial) { delay(10); } - Serial.begin(115200); - Serial.println("SPI device register test"); - - if (!spi_dev.begin()) { - Serial.println("Could not initialize SPI device"); - while (1); - } - - Adafruit_BusIO_Register id_reg = Adafruit_BusIO_Register(&spi_dev, 0x0F, ADDRBIT8_HIGH_TOREAD); - uint8_t id = 0; - id_reg.read(&id); - Serial.print("ID register = 0x"); Serial.println(id, HEX); - - Adafruit_BusIO_Register thresh_reg = Adafruit_BusIO_Register(&spi_dev, 0x0C, ADDRBIT8_HIGH_TOREAD, 2, LSBFIRST); - uint16_t thresh = 0; - thresh_reg.read(&thresh); - Serial.print("Initial threshold register = 0x"); Serial.println(thresh, HEX); - - thresh_reg.write(~thresh); - - Serial.print("Post threshold register = 0x"); Serial.println(thresh_reg.read(), HEX); -} - -void loop() { - -} diff --git a/.pio/libdeps/teensy41/Adafruit BusIO/library.properties b/.pio/libdeps/teensy41/Adafruit BusIO/library.properties deleted file mode 100644 index ba652bb..0000000 --- a/.pio/libdeps/teensy41/Adafruit BusIO/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=Adafruit BusIO -version=1.14.5 -author=Adafruit -maintainer=Adafruit -sentence=This is a library for abstracting away I2C and SPI interfacing -paragraph=This is a library for abstracting away I2C and SPI interfacing -category=Signal Input/Output -url=https://github.com/adafruit/Adafruit_BusIO -architectures=* diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/.github/ISSUE_TEMPLATE.md b/.pio/libdeps/teensy41/Adafruit LSM6DS/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index f0e2614..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,46 +0,0 @@ -Thank you for opening an issue on an Adafruit Arduino library repository. To -improve the speed of resolution please review the following guidelines and -common troubleshooting steps below before creating the issue: - -- **Do not use GitHub issues for troubleshooting projects and issues.** Instead use - the forums at http://forums.adafruit.com to ask questions and troubleshoot why - something isn't working as expected. In many cases the problem is a common issue - that you will more quickly receive help from the forum community. GitHub issues - are meant for known defects in the code. If you don't know if there is a defect - in the code then start with troubleshooting on the forum first. - -- **If following a tutorial or guide be sure you didn't miss a step.** Carefully - check all of the steps and commands to run have been followed. Consult the - forum if you're unsure or have questions about steps in a guide/tutorial. - -- **For Arduino projects check these very common issues to ensure they don't apply**: - - - For uploading sketches or communicating with the board make sure you're using - a **USB data cable** and **not** a **USB charge-only cable**. It is sometimes - very hard to tell the difference between a data and charge cable! Try using the - cable with other devices or swapping to another cable to confirm it is not - the problem. - - - **Be sure you are supplying adequate power to the board.** Check the specs of - your board and plug in an external power supply. In many cases just - plugging a board into your computer is not enough to power it and other - peripherals. - - - **Double check all soldering joints and connections.** Flakey connections - cause many mysterious problems. See the [guide to excellent soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering/tools) for examples of good solder joints. - - - **Ensure you are using an official Arduino or Adafruit board.** We can't - guarantee a clone board will have the same functionality and work as expected - with this code and don't support them. - -If you're sure this issue is a defect in the code and checked the steps above -please fill in the following fields to provide enough troubleshooting information. -You may delete the guideline and text above to just leave the following details: - -- Arduino board: **INSERT ARDUINO BOARD NAME/TYPE HERE** - -- Arduino IDE version (found in Arduino -> About Arduino menu): **INSERT ARDUINO - VERSION HERE** - -- List the steps to reproduce the problem below (if possible attach a sketch or - copy the sketch code in too): **LIST REPRO STEPS BELOW** diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/.github/PULL_REQUEST_TEMPLATE.md b/.pio/libdeps/teensy41/Adafruit LSM6DS/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 7b641eb..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,26 +0,0 @@ -Thank you for creating a pull request to contribute to Adafruit's GitHub code! -Before you open the request please review the following guidelines and tips to -help it be more easily integrated: - -- **Describe the scope of your change--i.e. what the change does and what parts - of the code were modified.** This will help us understand any risks of integrating - the code. - -- **Describe any known limitations with your change.** For example if the change - doesn't apply to a supported platform of the library please mention it. - -- **Please run any tests or examples that can exercise your modified code.** We - strive to not break users of the code and running tests/examples helps with this - process. - -Thank you again for contributing! We will try to test and integrate the change -as soon as we can, but be aware we have many GitHub repositories to manage and -can't immediately respond to every request. There is no need to bump or check in -on a pull request (it will clutter the discussion of the request). - -Also don't be worried if the request is closed or not integrated--sometimes the -priorities of Adafruit's GitHub code (education, ease of use) might not match the -priorities of the pull request. Don't fret, the open source community thrives on -forks and GitHub makes it easy to keep your changes in a forked repo. - -After reviewing the guidelines above you can delete this text from the pull request. diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/.github/workflows/githubci.yml b/.pio/libdeps/teensy41/Adafruit LSM6DS/.github/workflows/githubci.yml deleted file mode 100644 index c62a1db..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/.github/workflows/githubci.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Arduino Library CI - -on: [pull_request, push, repository_dispatch] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/setup-python@v1 - with: - python-version: '3.x' - - uses: actions/checkout@v2 - - uses: actions/checkout@v2 - with: - repository: adafruit/ci-arduino - path: ci - - - name: Install the prerequisites - run: bash ci/actions_install.sh - - - name: Check for correct code formatting with clang-format - run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r . - - - name: Check for correct documentation with doxygen - env: - GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }} - PRETTYNAME : "Adafruit LSM6DS Sensors Library" - run: bash ci/doxy_gen_and_deploy.sh - - - name: Test the code on supported platforms - run: python3 ci/build_platform.py main_platforms diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/.gitignore b/.pio/libdeps/teensy41/Adafruit LSM6DS/.gitignore deleted file mode 100644 index e7e2338..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -*.elf -*.hex -html/ -Doxyfile -.vscode/ diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/.piopm b/.pio/libdeps/teensy41/Adafruit LSM6DS/.piopm deleted file mode 100644 index 99e5f30..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/.piopm +++ /dev/null @@ -1 +0,0 @@ -{"type": "library", "name": "Adafruit LSM6DS", "version": "4.7.0", "spec": {"owner": "adafruit", "id": 6897, "name": "Adafruit LSM6DS", "requirements": null, "uri": null}} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_ISM330DHCX.cpp b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_ISM330DHCX.cpp deleted file mode 100644 index 7aec3a2..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_ISM330DHCX.cpp +++ /dev/null @@ -1,35 +0,0 @@ - -/*! - * @file Adafruit_ISM330DHCX.cpp Adafruit ISM330DHCX 6-DoF Accelerometer - * and Gyroscope library - * - * Bryan Siepert for Adafruit Industries - * BSD (see license.txt) - */ - -#include "Arduino.h" -#include - -#include "Adafruit_ISM330DHCX.h" - -/*! - * @brief Instantiates a new ISM330DHCX class - */ -Adafruit_ISM330DHCX::Adafruit_ISM330DHCX(void) {} - -bool Adafruit_ISM330DHCX::_init(int32_t sensor_id) { - // make sure we're talking to the right chip - if (chipID() != ISM330DHCX_CHIP_ID) { - return false; - } - _sensorid_accel = sensor_id; - _sensorid_gyro = sensor_id + 1; - _sensorid_temp = sensor_id + 2; - - reset(); - - // call base class _init() - Adafruit_LSM6DS::_init(sensor_id); - - return true; -} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_ISM330DHCX.h b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_ISM330DHCX.h deleted file mode 100644 index 5d6407a..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_ISM330DHCX.h +++ /dev/null @@ -1,38 +0,0 @@ -/*! - * @file Adafruit_ISM330DHCX.h - * - * I2C Driver for the Adafruit ISM330DHCX 6-DoF Accelerometer and Gyroscope - *library - * - * This is a library for the Adafruit ISM330DHCX breakout: - * https://www.adafruit.com/products/4480 - * - * Adafruit invests time and resources providing this open source code, - * please support Adafruit and open-source hardware by purchasing products from - * Adafruit! - * - * - * BSD license (see license.txt) - */ - -#ifndef _ADAFRUIT_ISM330DHCX_H -#define _ADAFRUIT_ISM330DHCX_H - -#include "Adafruit_LSM6DSOX.h" - -#define ISM330DHCX_CHIP_ID 0x6B ///< ISM330DHCX default device id from WHOAMI - -/*! - * @brief Class that stores state and functions for interacting with - * the ISM330DHCX I2C Digital Potentiometer - */ -class Adafruit_ISM330DHCX : public Adafruit_LSM6DSOX { -public: - Adafruit_ISM330DHCX(); - ~Adafruit_ISM330DHCX(){}; - -private: - bool _init(int32_t sensor_id); -}; - -#endif diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS.cpp b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS.cpp deleted file mode 100644 index 5a12521..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS.cpp +++ /dev/null @@ -1,895 +0,0 @@ - -/*! - * @file Adafruit_LSM6DS.cpp Adafruit LSM6DS 6-DoF Accelerometer - * and Gyroscope library - * - * @section intro_sec Introduction - * - * I2C Driver base for Adafruit LSM6DS 6-DoF Accelerometer - * and Gyroscope libraries - * - * Adafruit invests time and resources providing this open source code, - * please support Adafruit and open-source hardware by purchasing products from - * Adafruit! - * - * @section dependencies Dependencies - * This library depends on the Adafruit BusIO library - * - * This library depends on the Adafruit Unified Sensor library - - * @section author Author - * - * Bryan Siepert for Adafruit Industries - * - * @section license License - * - * BSD (see license.txt) - * - * @section HISTORY - * - * v1.0 - First release - */ - -#include "Arduino.h" -#include - -#include "Adafruit_LSM6DS.h" - -static const float _data_rate_arr[] = { - [LSM6DS_RATE_SHUTDOWN] = 0.0f, [LSM6DS_RATE_12_5_HZ] = 12.5f, - [LSM6DS_RATE_26_HZ] = 26.0f, [LSM6DS_RATE_52_HZ] = 52.0f, - [LSM6DS_RATE_104_HZ] = 104.0f, [LSM6DS_RATE_208_HZ] = 208.0f, - [LSM6DS_RATE_416_HZ] = 416.0f, [LSM6DS_RATE_833_HZ] = 833.0f, - [LSM6DS_RATE_1_66K_HZ] = 1660.0f, [LSM6DS_RATE_3_33K_HZ] = 3330.0f, - [LSM6DS_RATE_6_66K_HZ] = 6660.0f, -}; - -/*! - * @brief Instantiates a new LSM6DS class - */ -Adafruit_LSM6DS::Adafruit_LSM6DS(void) {} - -/*! - * @brief Cleans up the LSM6DS - */ -Adafruit_LSM6DS::~Adafruit_LSM6DS(void) { delete temp_sensor; } - -/*! @brief Unique subclass initializer post i2c/spi init - * @param sensor_id Optional unique ID for the sensor set - * @returns True if chip identified and initialized - */ -bool Adafruit_LSM6DS::_init(int32_t sensor_id) { - (void)sensor_id; - - // Enable accelerometer with 104 Hz data rate, 4G - setAccelDataRate(LSM6DS_RATE_104_HZ); - setAccelRange(LSM6DS_ACCEL_RANGE_4_G); - - // Enable gyro with 104 Hz data rate, 2000 dps - setGyroDataRate(LSM6DS_RATE_104_HZ); - setGyroRange(LSM6DS_GYRO_RANGE_2000_DPS); - - delay(10); - - // delete objects if sensor is reinitialized - delete temp_sensor; - delete accel_sensor; - delete gyro_sensor; - - temp_sensor = new Adafruit_LSM6DS_Temp(this); - accel_sensor = new Adafruit_LSM6DS_Accelerometer(this); - gyro_sensor = new Adafruit_LSM6DS_Gyro(this); - - return false; -}; - -/*! - * @brief Read chip identification register - * @returns 8 Bit value from WHOAMI register - */ -uint8_t Adafruit_LSM6DS::chipID(void) { - Adafruit_BusIO_Register chip_id = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_WHOAMI); - // Serial.print("Read ID 0x"); Serial.println(chip_id.read(), HEX); - - // make sure we're talking to the right chip - return chip_id.read(); -} - -/*! - * @brief Read Status register - * @returns 8 Bit value from Status register - */ -uint8_t Adafruit_LSM6DS::status(void) { - Adafruit_BusIO_Register status_reg = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_STATUS_REG); - return status_reg.read(); -} - -/*! - * @brief Sets up the hardware and initializes I2C - * @param i2c_address - * The I2C address to be used. - * @param wire - * The Wire object to be used for I2C connections. - * @param sensor_id - * The user-defined ID to differentiate different sensors - * @return True if initialization was successful, otherwise false. - */ -boolean Adafruit_LSM6DS::begin_I2C(uint8_t i2c_address, TwoWire *wire, - int32_t sensor_id) { - delete i2c_dev; // remove old interface - - i2c_dev = new Adafruit_I2CDevice(i2c_address, wire); - - if (!i2c_dev->begin()) { - return false; - } - - return _init(sensor_id); -} - -/*! - * @brief Sets up the hardware and initializes hardware SPI - * @param cs_pin The arduino pin # connected to chip select - * @param theSPI The SPI object to be used for SPI connections. - * @param frequency The SPI bus frequency - * @param sensor_id - * The user-defined ID to differentiate different sensors - * @return True if initialization was successful, otherwise false. - */ -bool Adafruit_LSM6DS::begin_SPI(uint8_t cs_pin, SPIClass *theSPI, - int32_t sensor_id, uint32_t frequency) { - i2c_dev = NULL; - - delete spi_dev; // remove old interface - - spi_dev = new Adafruit_SPIDevice(cs_pin, - frequency, // frequency - SPI_BITORDER_MSBFIRST, // bit order - SPI_MODE0, // data mode - theSPI); - if (!spi_dev->begin()) { - return false; - } - - return _init(sensor_id); -} - -/*! - * @brief Sets up the hardware and initializes software SPI - * @param cs_pin The arduino pin # connected to chip select - * @param sck_pin The arduino pin # connected to SPI clock - * @param miso_pin The arduino pin # connected to SPI MISO - * @param mosi_pin The arduino pin # connected to SPI MOSI - * @param frequency The SPI bus frequency - * @param sensor_id - * The user-defined ID to differentiate different sensors - * @return True if initialization was successful, otherwise false. - */ -bool Adafruit_LSM6DS::begin_SPI(int8_t cs_pin, int8_t sck_pin, int8_t miso_pin, - int8_t mosi_pin, int32_t sensor_id, - uint32_t frequency) { - i2c_dev = NULL; - - delete spi_dev; // remove old interface - - spi_dev = new Adafruit_SPIDevice(cs_pin, sck_pin, miso_pin, mosi_pin, - frequency, // frequency - SPI_BITORDER_MSBFIRST, // bit order - SPI_MODE0); // data mode - if (!spi_dev->begin()) { - return false; - } - - return _init(sensor_id); -} - -/**************************************************************************/ -/*! - @brief Resets the sensor to its power-on state, clearing all registers and - memory -*/ -void Adafruit_LSM6DS::reset(void) { - - Adafruit_BusIO_Register ctrl3 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL3_C); - - Adafruit_BusIO_RegisterBits sw_reset = - Adafruit_BusIO_RegisterBits(&ctrl3, 1, 0); - - // Adafruit_BusIO_RegisterBits boot = Adafruit_BusIO_RegisterBits(&ctrl3, 1, - // 7); - - sw_reset.write(true); - - while (sw_reset.read()) { - delay(1); - } -} - -/*! - @brief Gets an Adafruit Unified Sensor object for the temp sensor component - @return Adafruit_Sensor pointer to temperature sensor - */ -Adafruit_Sensor *Adafruit_LSM6DS::getTemperatureSensor(void) { - return temp_sensor; -} - -/*! - @brief Gets an Adafruit Unified Sensor object for the accelerometer - sensor component - @return Adafruit_Sensor pointer to accelerometer sensor - */ -Adafruit_Sensor *Adafruit_LSM6DS::getAccelerometerSensor(void) { - return accel_sensor; -} - -/*! - @brief Gets an Adafruit Unified Sensor object for the gyro sensor component - @return Adafruit_Sensor pointer to gyro sensor - */ -Adafruit_Sensor *Adafruit_LSM6DS::getGyroSensor(void) { return gyro_sensor; } - -/**************************************************************************/ -/*! - @brief Gets the most recent sensor event, Adafruit Unified Sensor format - @param accel - Pointer to an Adafruit Unified sensor_event_t object to be filled - with acceleration event data. - - @param gyro - Pointer to an Adafruit Unified sensor_event_t object to be filled - with gyro event data. - - @param temp - Pointer to an Adafruit Unified sensor_event_t object to be filled - with temperature event data. - - @return True on successful read -*/ -/**************************************************************************/ -bool Adafruit_LSM6DS::getEvent(sensors_event_t *accel, sensors_event_t *gyro, - sensors_event_t *temp) { - uint32_t t = millis(); - _read(); - - // use helpers to fill in the events - fillAccelEvent(accel, t); - fillGyroEvent(gyro, t); - fillTempEvent(temp, t); - return true; -} - -void Adafruit_LSM6DS::fillTempEvent(sensors_event_t *temp, uint32_t timestamp) { - memset(temp, 0, sizeof(sensors_event_t)); - temp->version = sizeof(sensors_event_t); - temp->sensor_id = _sensorid_temp; - temp->type = SENSOR_TYPE_AMBIENT_TEMPERATURE; - temp->timestamp = timestamp; - temp->temperature = temperature; -} - -void Adafruit_LSM6DS::fillGyroEvent(sensors_event_t *gyro, uint32_t timestamp) { - memset(gyro, 0, sizeof(sensors_event_t)); - gyro->version = 1; - gyro->sensor_id = _sensorid_gyro; - gyro->type = SENSOR_TYPE_GYROSCOPE; - gyro->timestamp = timestamp; - gyro->gyro.x = gyroX; - gyro->gyro.y = gyroY; - gyro->gyro.z = gyroZ; -} - -void Adafruit_LSM6DS::fillAccelEvent(sensors_event_t *accel, - uint32_t timestamp) { - memset(accel, 0, sizeof(sensors_event_t)); - accel->version = 1; - accel->sensor_id = _sensorid_accel; - accel->type = SENSOR_TYPE_ACCELEROMETER; - accel->timestamp = timestamp; - accel->acceleration.x = accX; - accel->acceleration.y = accY; - accel->acceleration.z = accZ; -} - -/**************************************************************************/ -/*! - @brief Gets the accelerometer data rate. - @returns The the accelerometer data rate. -*/ -lsm6ds_data_rate_t Adafruit_LSM6DS::getAccelDataRate(void) { - - Adafruit_BusIO_Register ctrl1 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL1_XL); - - Adafruit_BusIO_RegisterBits accel_data_rate = - Adafruit_BusIO_RegisterBits(&ctrl1, 4, 4); - - return (lsm6ds_data_rate_t)accel_data_rate.read(); -} - -/**************************************************************************/ -/*! - @brief Sets the accelerometer data rate. - @param data_rate - The the accelerometer data rate. Must be a `lsm6ds_data_rate_t`. -*/ -void Adafruit_LSM6DS::setAccelDataRate(lsm6ds_data_rate_t data_rate) { - - Adafruit_BusIO_Register ctrl1 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL1_XL); - - Adafruit_BusIO_RegisterBits accel_data_rate = - Adafruit_BusIO_RegisterBits(&ctrl1, 4, 4); - - accel_data_rate.write(data_rate); -} - -/**************************************************************************/ -/*! - @brief Gets the accelerometer measurement range. - @returns The the accelerometer measurement range. -*/ -lsm6ds_accel_range_t Adafruit_LSM6DS::getAccelRange(void) { - - Adafruit_BusIO_Register ctrl1 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL1_XL); - - Adafruit_BusIO_RegisterBits accel_range = - Adafruit_BusIO_RegisterBits(&ctrl1, 2, 2); - - accelRangeBuffered = (lsm6ds_accel_range_t)accel_range.read(); - - return accelRangeBuffered; -} -/**************************************************************************/ -/*! - @brief Sets the accelerometer measurement range. - @param new_range The `lsm6ds_accel_range_t` range to set. -*/ -void Adafruit_LSM6DS::setAccelRange(lsm6ds_accel_range_t new_range) { - - Adafruit_BusIO_Register ctrl1 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL1_XL); - - Adafruit_BusIO_RegisterBits accel_range = - Adafruit_BusIO_RegisterBits(&ctrl1, 2, 2); - - accel_range.write(new_range); - - accelRangeBuffered = new_range; -} - -/**************************************************************************/ -/*! - @brief Gets the gyro data rate. - @returns The the gyro data rate. -*/ -lsm6ds_data_rate_t Adafruit_LSM6DS::getGyroDataRate(void) { - - Adafruit_BusIO_Register ctrl2 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL2_G); - - Adafruit_BusIO_RegisterBits gyro_data_rate = - Adafruit_BusIO_RegisterBits(&ctrl2, 4, 4); - - return (lsm6ds_data_rate_t)gyro_data_rate.read(); -} - -/**************************************************************************/ -/*! - @brief Sets the gyro data rate. - @param data_rate - The the gyro data rate. Must be a `lsm6ds_data_rate_t`. -*/ -void Adafruit_LSM6DS::setGyroDataRate(lsm6ds_data_rate_t data_rate) { - - Adafruit_BusIO_Register ctrl2 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL2_G); - - Adafruit_BusIO_RegisterBits gyro_data_rate = - Adafruit_BusIO_RegisterBits(&ctrl2, 4, 4); - - gyro_data_rate.write(data_rate); -} - -/**************************************************************************/ -/*! - @brief Gets the gyro range. - @returns The the gyro range. -*/ -lsm6ds_gyro_range_t Adafruit_LSM6DS::getGyroRange(void) { - - Adafruit_BusIO_Register ctrl2 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL2_G); - - Adafruit_BusIO_RegisterBits gyro_range = - Adafruit_BusIO_RegisterBits(&ctrl2, 4, 0); - - gyroRangeBuffered = (lsm6ds_gyro_range_t)gyro_range.read(); - - return gyroRangeBuffered; -} - -/**************************************************************************/ -/*! - @brief Sets the gyro range. - @param new_range The `lsm6ds_gyro_range_t` to set. -*/ -void Adafruit_LSM6DS::setGyroRange(lsm6ds_gyro_range_t new_range) { - - Adafruit_BusIO_Register ctrl2 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL2_G); - - Adafruit_BusIO_RegisterBits gyro_range = - Adafruit_BusIO_RegisterBits(&ctrl2, 4, 0); - - gyro_range.write(new_range); - - gyroRangeBuffered = new_range; -} - -/**************************************************************************/ -/*! - @brief Enables the high pass filter and/or slope filter - @param filter_enabled Whether to enable the slope filter (see datasheet) - @param filter The lsm6ds_hp_filter_t that sets the data rate divisor -*/ -/**************************************************************************/ -void Adafruit_LSM6DS::highPassFilter(bool filter_enabled, - lsm6ds_hp_filter_t filter) { - Adafruit_BusIO_Register ctrl8 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL8_XL); - Adafruit_BusIO_RegisterBits HPF_en = - Adafruit_BusIO_RegisterBits(&ctrl8, 1, 2); - Adafruit_BusIO_RegisterBits HPF_filter = - Adafruit_BusIO_RegisterBits(&ctrl8, 2, 5); - HPF_en.write(filter_enabled); - HPF_filter.write(filter); -} - -/******************* Adafruit_Sensor functions *****************/ -/*! - * @brief Updates the measurement data for all sensors simultaneously - */ -/**************************************************************************/ -void Adafruit_LSM6DS::_read(void) { - // get raw readings - Adafruit_BusIO_Register data_reg = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_OUT_TEMP_L, 14); - - uint8_t buffer[14]; - data_reg.read(buffer, 14); - - rawTemp = buffer[1] << 8 | buffer[0]; - temperature = (rawTemp / temperature_sensitivity) + 25.0; - - rawGyroX = buffer[3] << 8 | buffer[2]; - rawGyroY = buffer[5] << 8 | buffer[4]; - rawGyroZ = buffer[7] << 8 | buffer[6]; - - rawAccX = buffer[9] << 8 | buffer[8]; - rawAccY = buffer[11] << 8 | buffer[10]; - rawAccZ = buffer[13] << 8 | buffer[12]; - - float gyro_scale = 1; // range is in milli-dps per bit! - switch (gyroRangeBuffered) { - case ISM330DHCX_GYRO_RANGE_4000_DPS: - gyro_scale = 140.0; - break; - case LSM6DS_GYRO_RANGE_2000_DPS: - gyro_scale = 70.0; - break; - case LSM6DS_GYRO_RANGE_1000_DPS: - gyro_scale = 35.0; - break; - case LSM6DS_GYRO_RANGE_500_DPS: - gyro_scale = 17.50; - break; - case LSM6DS_GYRO_RANGE_250_DPS: - gyro_scale = 8.75; - break; - case LSM6DS_GYRO_RANGE_125_DPS: - gyro_scale = 4.375; - break; - } - - gyroX = rawGyroX * gyro_scale * SENSORS_DPS_TO_RADS / 1000.0; - gyroY = rawGyroY * gyro_scale * SENSORS_DPS_TO_RADS / 1000.0; - gyroZ = rawGyroZ * gyro_scale * SENSORS_DPS_TO_RADS / 1000.0; - - float accel_scale = 1; // range is in milli-g per bit! - switch (accelRangeBuffered) { - case LSM6DS_ACCEL_RANGE_16_G: - accel_scale = 0.488; - break; - case LSM6DS_ACCEL_RANGE_8_G: - accel_scale = 0.244; - break; - case LSM6DS_ACCEL_RANGE_4_G: - accel_scale = 0.122; - break; - case LSM6DS_ACCEL_RANGE_2_G: - accel_scale = 0.061; - break; - } - - accX = rawAccX * accel_scale * SENSORS_GRAVITY_STANDARD / 1000; - accY = rawAccY * accel_scale * SENSORS_GRAVITY_STANDARD / 1000; - accZ = rawAccZ * accel_scale * SENSORS_GRAVITY_STANDARD / 1000; -} - -/**************************************************************************/ -/*! - @brief Sets the INT1 and INT2 pin activation mode - @param active_low true to set the pins as active high, false to set the - mode to active low - @param open_drain true to set the pin mode as open-drain, false to set the - mode to push-pull -*/ -void Adafruit_LSM6DS::configIntOutputs(bool active_low, bool open_drain) { - - Adafruit_BusIO_Register ctrl3 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL3_C); - Adafruit_BusIO_RegisterBits ppod_bits = - Adafruit_BusIO_RegisterBits(&ctrl3, 2, 4); - - ppod_bits.write((active_low << 1) | open_drain); -} - -/**************************************************************************/ -/*! - @brief Enables and disables the data ready interrupt on INT 1. - @param drdy_temp true to output the data ready temperature interrupt - @param drdy_g true to output the data ready gyro interrupt - @param drdy_xl true to output the data ready accelerometer interrupt - @param step_detect true to output the step detection interrupt (default off) - @param wakeup true to output the wake up interrupt (default off) -*/ -void Adafruit_LSM6DS::configInt1(bool drdy_temp, bool drdy_g, bool drdy_xl, - bool step_detect, bool wakeup) { - - Adafruit_BusIO_Register int1_ctrl = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_INT1_CTRL); - - int1_ctrl.write((step_detect << 7) | (drdy_temp << 2) | (drdy_g << 1) | - drdy_xl); - - Adafruit_BusIO_Register md1cfg = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_MD1_CFG); - - Adafruit_BusIO_RegisterBits wu = Adafruit_BusIO_RegisterBits(&md1cfg, 1, 5); - wu.write(wakeup); -} - -/**************************************************************************/ -/*! - @brief Enables and disables the data ready interrupt on INT 2. - @param drdy_temp true to output the data ready temperature interrupt - @param drdy_g true to output the data ready gyro interrupt - @param drdy_xl true to output the data ready accelerometer interrupt -*/ -void Adafruit_LSM6DS::configInt2(bool drdy_temp, bool drdy_g, bool drdy_xl) { - - Adafruit_BusIO_Register int2_ctrl = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_INT2_CTRL); - - Adafruit_BusIO_RegisterBits int2_drdy_bits = - Adafruit_BusIO_RegisterBits(&int2_ctrl, 3, 0); - - int2_drdy_bits.write((drdy_temp << 2) | (drdy_g << 1) | drdy_xl); -} - -/**************************************************************************/ -/*! - @brief Gets the sensor_t data for the LSM6DS's gyroscope sensor -*/ -/**************************************************************************/ -void Adafruit_LSM6DS_Gyro::getSensor(sensor_t *sensor) { - /* Clear the sensor_t object */ - memset(sensor, 0, sizeof(sensor_t)); - - /* Insert the sensor name in the fixed length char array */ - strncpy(sensor->name, "LSM6DS_G", sizeof(sensor->name) - 1); - sensor->name[sizeof(sensor->name) - 1] = 0; - sensor->version = 1; - sensor->sensor_id = _sensorID; - sensor->type = SENSOR_TYPE_GYROSCOPE; - sensor->min_delay = 0; - sensor->min_value = -34.91; /* -2000 dps -> rad/s (radians per second) */ - sensor->max_value = +34.91; - sensor->resolution = 7.6358e-5; /* 4.375 mdps -> rad/s */ -} - -/**************************************************************************/ -/*! - @brief Gets the gyroscope as a standard sensor event - @param event Sensor event object that will be populated - @returns True -*/ -/**************************************************************************/ -bool Adafruit_LSM6DS_Gyro::getEvent(sensors_event_t *event) { - _theLSM6DS->_read(); - _theLSM6DS->fillGyroEvent(event, millis()); - - return true; -} - -/**************************************************************************/ -/*! - @brief Gets the sensor_t data for the LSM6DS's accelerometer -*/ -/**************************************************************************/ -void Adafruit_LSM6DS_Accelerometer::getSensor(sensor_t *sensor) { - /* Clear the sensor_t object */ - memset(sensor, 0, sizeof(sensor_t)); - - /* Insert the sensor name in the fixed length char array */ - strncpy(sensor->name, "LSM6DS_A", sizeof(sensor->name) - 1); - sensor->name[sizeof(sensor->name) - 1] = 0; - sensor->version = 1; - sensor->sensor_id = _sensorID; - sensor->type = SENSOR_TYPE_ACCELEROMETER; - sensor->min_delay = 0; - sensor->min_value = -156.9064F; /* -16g = 156.9064 m/s^2 */ - sensor->max_value = 156.9064F; /* 16g = 156.9064 m/s^2 */ - sensor->resolution = 0.061; /* 0.061 mg/LSB at +-2g */ -} - -/**************************************************************************/ -/*! - @brief Gets the accelerometer as a standard sensor event - @param event Sensor event object that will be populated - @returns True -*/ -/**************************************************************************/ -bool Adafruit_LSM6DS_Accelerometer::getEvent(sensors_event_t *event) { - _theLSM6DS->_read(); - _theLSM6DS->fillAccelEvent(event, millis()); - - return true; -} - -/**************************************************************************/ -/*! - @brief Gets the sensor_t data for the LSM6DS's tenperature -*/ -/**************************************************************************/ -void Adafruit_LSM6DS_Temp::getSensor(sensor_t *sensor) { - /* Clear the sensor_t object */ - memset(sensor, 0, sizeof(sensor_t)); - - /* Insert the sensor name in the fixed length char array */ - strncpy(sensor->name, "LSM6DS_T", sizeof(sensor->name) - 1); - sensor->name[sizeof(sensor->name) - 1] = 0; - sensor->version = 1; - sensor->sensor_id = _sensorID; - sensor->type = SENSOR_TYPE_AMBIENT_TEMPERATURE; - sensor->min_delay = 0; - sensor->min_value = -40; - sensor->max_value = 85; - sensor->resolution = 1; /* not a great sensor */ -} - -/**************************************************************************/ -/*! - @brief Gets the temperature as a standard sensor event - @param event Sensor event object that will be populated - @returns True -*/ -/**************************************************************************/ -bool Adafruit_LSM6DS_Temp::getEvent(sensors_event_t *event) { - _theLSM6DS->_read(); - _theLSM6DS->fillTempEvent(event, millis()); - - return true; -} - -/**************************************************************************/ -/*! - @brief Enables and disables the pedometer function - @param enable True to turn on the pedometer function, false to turn off -*/ -/**************************************************************************/ -void Adafruit_LSM6DS::enablePedometer(bool enable) { - // enable or disable step counter - Adafruit_BusIO_Register tapcfg = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_TAP_CFG); - Adafruit_BusIO_RegisterBits pedo_en = - Adafruit_BusIO_RegisterBits(&tapcfg, 1, 6); - pedo_en.write(enable); - - // enable or disable functionality - Adafruit_BusIO_Register ctrl10 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL10_C); - Adafruit_BusIO_RegisterBits func_en = - Adafruit_BusIO_RegisterBits(&ctrl10, 1, 2); - func_en.write(enable); - - resetPedometer(); -} - -/**************************************************************************/ -/*! - @brief Enables and disables the wakeup function - @param enable True to turn on the wakeup function, false to turn off - @param duration How many > threshold readings to generate a wakeup - @param thresh The threshold (sensitivity) -*/ -/**************************************************************************/ -void Adafruit_LSM6DS::enableWakeup(bool enable, uint8_t duration, - uint8_t thresh) { - // enable or disable functionality - Adafruit_BusIO_Register tapcfg = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_TAP_CFG); - Adafruit_BusIO_RegisterBits slope_en = - Adafruit_BusIO_RegisterBits(&tapcfg, 1, 4); - Adafruit_BusIO_RegisterBits timer_en = - Adafruit_BusIO_RegisterBits(&tapcfg, 1, 7); - slope_en.write(enable); - timer_en.write(enable); - if (enable) { - Adafruit_BusIO_Register wake_dur = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_WAKEUP_DUR); - Adafruit_BusIO_RegisterBits durbits = - Adafruit_BusIO_RegisterBits(&wake_dur, 2, 5); - durbits.write(duration); - - Adafruit_BusIO_Register wake_ths = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_WAKEUP_THS); - Adafruit_BusIO_RegisterBits thsbits = - Adafruit_BusIO_RegisterBits(&wake_ths, 6, 0); - thsbits.write(thresh); - } -} - -/**************************************************************************/ -/*! - @brief Checks interrupt register to see if we have a wake signal - @returns True if wake event bit is set in WAKEUP_SRC (cleared on read) -*/ -/**************************************************************************/ -bool Adafruit_LSM6DS::awake(void) { - Adafruit_BusIO_Register wakesrc = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_WAKEUP_SRC); - Adafruit_BusIO_RegisterBits wake_evt = - Adafruit_BusIO_RegisterBits(&wakesrc, 1, 3); - return wake_evt.read(); -} - -/**************************************************************************/ -/*! - @brief Simple shake detection. Must call enableWakeup() first. - @returns True if shake (wake) detected, otherwise false. -*/ -/**************************************************************************/ -bool Adafruit_LSM6DS::shake(void) { - Adafruit_BusIO_Register tapcfg = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_TAP_CFG); - Adafruit_BusIO_RegisterBits slope_en = - Adafruit_BusIO_RegisterBits(&tapcfg, 1, 4); - Adafruit_BusIO_RegisterBits timer_en = - Adafruit_BusIO_RegisterBits(&tapcfg, 1, 7); - // only check if enabled - if (slope_en.read() && timer_en.read()) { - return awake(); - } - return false; -} - -/**************************************************************************/ -/*! - @brief Reset the pedometer count -*/ -/**************************************************************************/ -void Adafruit_LSM6DS::resetPedometer(void) { - // reset bit to clear counter - Adafruit_BusIO_Register ctrl10 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL10_C); - Adafruit_BusIO_RegisterBits ped_rst = - Adafruit_BusIO_RegisterBits(&ctrl10, 1, 1); - ped_rst.write(true); -} - -/**************************************************************************/ -/*! - @brief Read the 16-bit pedometer count - @returns The value from the step counter -*/ -/**************************************************************************/ -uint16_t Adafruit_LSM6DS::readPedometer(void) { - Adafruit_BusIO_Register steps_reg = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_STEPCOUNTER, 2); - return steps_reg.read(); -} - -/**************************************************************************/ -/*! - @brief Gets the accelerometer data rate. - @returns The data rate in float -*/ -float Adafruit_LSM6DS::accelerationSampleRate(void) { - return _data_rate_arr[this->getAccelDataRate()]; -} - -/**************************************************************************/ -/*! - @brief Check for available data from accelerometer - @returns 1 if available, 0 if not -*/ -int Adafruit_LSM6DS::accelerationAvailable(void) { - return (this->status() & 0x01) ? 1 : 0; -} - -/**************************************************************************/ -/*! - @brief Read accelerometer data - @param x reference to x axis - @param y reference to y axis - @param z reference to z axis - @returns 1 if success, 0 if not -*/ -int Adafruit_LSM6DS::readAcceleration(float &x, float &y, float &z) { - int16_t data[3]; - - Adafruit_BusIO_Register accel_data = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_OUTX_L_A, 6); - - if (!accel_data.read((uint8_t *)data, sizeof(data))) { - x = y = z = NAN; - return 0; - } - - // scale to range of -4 – 4 - x = data[0] * 4.0 / 32768.0; - y = data[1] * 4.0 / 32768.0; - z = data[2] * 4.0 / 32768.0; - - return 1; -} - -/**************************************************************************/ -/*! - @brief Get the gyroscope data rate. - @returns The data rate in float -*/ -float Adafruit_LSM6DS::gyroscopeSampleRate(void) { - return _data_rate_arr[this->getGyroDataRate()]; -} - -/**************************************************************************/ -/*! - @brief Check for available data from gyroscope - @returns 1 if available, 0 if not -*/ -int Adafruit_LSM6DS::gyroscopeAvailable(void) { - return (this->status() & 0x02) ? 1 : 0; -} - -/**************************************************************************/ -/*! - @brief Read gyroscope data - @param x reference to x axis - @param y reference to y axis - @param z reference to z axis - @returns 1 if success, 0 if not -*/ -int Adafruit_LSM6DS::readGyroscope(float &x, float &y, float &z) { - int16_t data[3]; - - Adafruit_BusIO_Register gyro_data = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_OUTX_L_G, 6); - - if (!gyro_data.read((uint8_t *)data, sizeof(data))) { - x = y = z = NAN; - return 0; - } - - // scale to range of -2000 – 2000 - x = data[0] * 2000.0 / 32768.0; - y = data[1] * 2000.0 / 32768.0; - z = data[2] * 2000.0 / 32768.0; - - return 1; -} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS.h b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS.h deleted file mode 100644 index bad4eaa..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS.h +++ /dev/null @@ -1,251 +0,0 @@ -/*! - * @file Adafruit_LSM6DS.h - * - * I2C Driver base for Adafruit LSM6DSxx 6-DoF Accelerometer and Gyroscope - * library - * - * Adafruit invests time and resources providing this open source code, - * please support Adafruit and open-source hardware by purchasing products - *from Adafruit! - * - * BSD license (see license.txt) - */ - -#ifndef _ADAFRUIT_LSM6DS_H -#define _ADAFRUIT_LSM6DS_H - -#include "Arduino.h" -#include -#include -#include -#include - -#define LSM6DS_I2CADDR_DEFAULT 0x6A ///< LSM6DS default i2c address - -#define LSM6DS_FUNC_CFG_ACCESS 0x1 ///< Enable embedded functions register -#define LSM6DS_INT1_CTRL 0x0D ///< Interrupt control for INT 1 -#define LSM6DS_INT2_CTRL 0x0E ///< Interrupt control for INT 2 -#define LSM6DS_WHOAMI 0x0F ///< Chip ID register -#define LSM6DS_CTRL1_XL 0x10 ///< Main accelerometer config register -#define LSM6DS_CTRL2_G 0x11 ///< Main gyro config register -#define LSM6DS_CTRL3_C 0x12 ///< Main configuration register -#define LSM6DS_CTRL8_XL 0x17 ///< High and low pass for accel -#define LSM6DS_CTRL10_C 0x19 ///< Main configuration register -#define LSM6DS_WAKEUP_SRC 0x1B ///< Why we woke up -#define LSM6DS_STATUS_REG 0X1E ///< Status register -#define LSM6DS_OUT_TEMP_L 0x20 ///< First data register (temperature low) -#define LSM6DS_OUTX_L_G 0x22 ///< First gyro data register -#define LSM6DS_OUTX_L_A 0x28 ///< First accel data register -#define LSM6DS_STEPCOUNTER 0x4B ///< 16-bit step counter -#define LSM6DS_TAP_CFG 0x58 ///< Tap/pedometer configuration -#define LSM6DS_WAKEUP_THS \ - 0x5B ///< Single and double-tap function threshold register -#define LSM6DS_WAKEUP_DUR \ - 0x5C ///< Free-fall, wakeup, timestamp and sleep mode duration -#define LSM6DS_MD1_CFG 0x5E ///< Functions routing on INT1 register - -/** The accelerometer data rate */ -typedef enum data_rate { - LSM6DS_RATE_SHUTDOWN, - LSM6DS_RATE_12_5_HZ, - LSM6DS_RATE_26_HZ, - LSM6DS_RATE_52_HZ, - LSM6DS_RATE_104_HZ, - LSM6DS_RATE_208_HZ, - LSM6DS_RATE_416_HZ, - LSM6DS_RATE_833_HZ, - LSM6DS_RATE_1_66K_HZ, - LSM6DS_RATE_3_33K_HZ, - LSM6DS_RATE_6_66K_HZ, -} lsm6ds_data_rate_t; - -/** The accelerometer data range */ -typedef enum accel_range { - LSM6DS_ACCEL_RANGE_2_G, - LSM6DS_ACCEL_RANGE_16_G, - LSM6DS_ACCEL_RANGE_4_G, - LSM6DS_ACCEL_RANGE_8_G -} lsm6ds_accel_range_t; - -/** The gyro data range */ -typedef enum gyro_range { - LSM6DS_GYRO_RANGE_125_DPS = 0b0010, - LSM6DS_GYRO_RANGE_250_DPS = 0b0000, - LSM6DS_GYRO_RANGE_500_DPS = 0b0100, - LSM6DS_GYRO_RANGE_1000_DPS = 0b1000, - LSM6DS_GYRO_RANGE_2000_DPS = 0b1100, - ISM330DHCX_GYRO_RANGE_4000_DPS = 0b0001 -} lsm6ds_gyro_range_t; - -/** The high pass filter bandwidth */ -typedef enum hpf_range { - LSM6DS_HPF_ODR_DIV_50 = 0, - LSM6DS_HPF_ODR_DIV_100 = 1, - LSM6DS_HPF_ODR_DIV_9 = 2, - LSM6DS_HPF_ODR_DIV_400 = 3, -} lsm6ds_hp_filter_t; - -class Adafruit_LSM6DS; - -/** Adafruit Unified Sensor interface for temperature component of LSM6DS */ -class Adafruit_LSM6DS_Temp : public Adafruit_Sensor { -public: - /** @brief Create an Adafruit_Sensor compatible object for the temp sensor - @param parent A pointer to the LSM6DS class */ - Adafruit_LSM6DS_Temp(Adafruit_LSM6DS *parent) { _theLSM6DS = parent; } - bool getEvent(sensors_event_t *); - void getSensor(sensor_t *); - -private: - int _sensorID = 0x6D0; - Adafruit_LSM6DS *_theLSM6DS = NULL; -}; - -/** Adafruit Unified Sensor interface for accelerometer component of LSM6DS */ -class Adafruit_LSM6DS_Accelerometer : public Adafruit_Sensor { -public: - /** @brief Create an Adafruit_Sensor compatible object for the accelerometer - sensor - @param parent A pointer to the LSM6DS class */ - Adafruit_LSM6DS_Accelerometer(Adafruit_LSM6DS *parent) { - _theLSM6DS = parent; - } - bool getEvent(sensors_event_t *); - void getSensor(sensor_t *); - -private: - int _sensorID = 0x6D1; - Adafruit_LSM6DS *_theLSM6DS = NULL; -}; - -/** Adafruit Unified Sensor interface for gyro component of LSM6DS */ -class Adafruit_LSM6DS_Gyro : public Adafruit_Sensor { -public: - /** @brief Create an Adafruit_Sensor compatible object for the gyro sensor - @param parent A pointer to the LSM6DS class */ - Adafruit_LSM6DS_Gyro(Adafruit_LSM6DS *parent) { _theLSM6DS = parent; } - bool getEvent(sensors_event_t *); - void getSensor(sensor_t *); - -private: - int _sensorID = 0x6D2; - Adafruit_LSM6DS *_theLSM6DS = NULL; -}; - -/*! - * @brief Class that stores state and functions for interacting with - * the LSM6DS I2C Accel/Gyro - */ -class Adafruit_LSM6DS { -public: - Adafruit_LSM6DS(); - virtual ~Adafruit_LSM6DS(); - - bool begin_I2C(uint8_t i2c_addr = LSM6DS_I2CADDR_DEFAULT, - TwoWire *wire = &Wire, int32_t sensorID = 0); - - bool begin_SPI(uint8_t cs_pin, SPIClass *theSPI = &SPI, int32_t sensorID = 0, - uint32_t frequency = 1000000); - bool begin_SPI(int8_t cs_pin, int8_t sck_pin, int8_t miso_pin, - int8_t mosi_pin, int32_t sensorID = 0, - uint32_t frequency = 1000000); - - bool getEvent(sensors_event_t *accel, sensors_event_t *gyro, - sensors_event_t *temp); - - lsm6ds_data_rate_t getAccelDataRate(void); - void setAccelDataRate(lsm6ds_data_rate_t data_rate); - - lsm6ds_accel_range_t getAccelRange(void); - void setAccelRange(lsm6ds_accel_range_t new_range); - - lsm6ds_data_rate_t getGyroDataRate(void); - void setGyroDataRate(lsm6ds_data_rate_t data_rate); - - lsm6ds_gyro_range_t getGyroRange(void); - void setGyroRange(lsm6ds_gyro_range_t new_range); - - void reset(void); - void configIntOutputs(bool active_low, bool open_drain); - void configInt1(bool drdy_temp, bool drdy_g, bool drdy_xl, - bool step_detect = false, bool wakeup = false); - void configInt2(bool drdy_temp, bool drdy_g, bool drdy_xl); - void highPassFilter(bool enabled, lsm6ds_hp_filter_t filter); - - void enableWakeup(bool enable, uint8_t duration = 0, uint8_t thresh = 20); - bool awake(void); - bool shake(void); - - void enablePedometer(bool enable); - void resetPedometer(void); - uint16_t readPedometer(void); - - // Arduino compatible API - int readAcceleration(float &x, float &y, float &z); - float accelerationSampleRate(void); - int accelerationAvailable(void); - - int readGyroscope(float &x, float &y, float &z); - float gyroscopeSampleRate(void); - int gyroscopeAvailable(void); - - int16_t rawAccX, ///< Last reading's raw accelerometer X axis - rawAccY, ///< Last reading's raw accelerometer Y axis - rawAccZ, ///< Last reading's raw accelerometer Z axis - rawTemp, ///< Last reading's raw temperature reading - rawGyroX, ///< Last reading's raw gyro X axis - rawGyroY, ///< Last reading's raw gyro Y axis - rawGyroZ; ///< Last reading's raw gyro Z axis - - float temperature, ///< Last reading's temperature (C) - accX, ///< Last reading's accelerometer X axis m/s^2 - accY, ///< Last reading's accelerometer Y axis m/s^2 - accZ, ///< Last reading's accelerometer Z axis m/s^2 - gyroX, ///< Last reading's gyro X axis in rad/s - gyroY, ///< Last reading's gyro Y axis in rad/s - gyroZ; ///< Last reading's gyro Z axis in rad/s - - Adafruit_Sensor *getTemperatureSensor(void); - Adafruit_Sensor *getAccelerometerSensor(void); - Adafruit_Sensor *getGyroSensor(void); - -protected: - uint8_t chipID(void); - uint8_t status(void); - virtual void _read(void); - virtual bool _init(int32_t sensor_id); - - uint16_t _sensorid_accel, ///< ID number for accelerometer - _sensorid_gyro, ///< ID number for gyro - _sensorid_temp; ///< ID number for temperature - - Adafruit_I2CDevice *i2c_dev = NULL; ///< Pointer to I2C bus interface - Adafruit_SPIDevice *spi_dev = NULL; ///< Pointer to SPI bus interface - - float temperature_sensitivity = - 256.0; ///< Temp sensor sensitivity in LSB/degC - Adafruit_LSM6DS_Temp *temp_sensor = NULL; ///< Temp sensor data object - Adafruit_LSM6DS_Accelerometer *accel_sensor = - NULL; ///< Accelerometer data object - Adafruit_LSM6DS_Gyro *gyro_sensor = NULL; ///< Gyro data object - - //! buffer for the accelerometer range - lsm6ds_accel_range_t accelRangeBuffered = LSM6DS_ACCEL_RANGE_2_G; - //! buffer for the gyroscope range - lsm6ds_gyro_range_t gyroRangeBuffered = LSM6DS_GYRO_RANGE_250_DPS; - -private: - friend class Adafruit_LSM6DS_Temp; ///< Gives access to private members to - ///< Temp data object - friend class Adafruit_LSM6DS_Accelerometer; ///< Gives access to private - ///< members to Accelerometer data - ///< object - friend class Adafruit_LSM6DS_Gyro; ///< Gives access to private members to - ///< Gyro data object - - void fillTempEvent(sensors_event_t *temp, uint32_t timestamp); - void fillAccelEvent(sensors_event_t *accel, uint32_t timestamp); - void fillGyroEvent(sensors_event_t *gyro, uint32_t timestamp); -}; - -#endif diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3.cpp b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3.cpp deleted file mode 100644 index ef91032..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3.cpp +++ /dev/null @@ -1,51 +0,0 @@ - -/*! - * @file Adafruit_LSM6DS3.cpp Adafruit LSM6DS3 6-DoF Accelerometer - * and Gyroscope library - * - * Bryan Siepert for Adafruit Industries - * BSD (see license.txt) - */ - -#include "Arduino.h" -#include - -#include "Adafruit_LSM6DS3.h" - -/*! - * @brief Instantiates a new LSM6DS3 class - */ -Adafruit_LSM6DS3::Adafruit_LSM6DS3(void) {} - -bool Adafruit_LSM6DS3::_init(int32_t sensor_id) { - // make sure we're talking to the right chip - if (chipID() != LSM6DS3_CHIP_ID) { - return false; - } - _sensorid_accel = sensor_id; - _sensorid_gyro = sensor_id + 1; - _sensorid_temp = sensor_id + 2; - - temperature_sensitivity = 16.0; - - reset(); - - // call base class _init() - Adafruit_LSM6DS::_init(sensor_id); - - return true; -} - -/**************************************************************************/ -/*! - @brief Enables and disables the I2C master bus pulllups. - @param enable_pullups true to enable the I2C pullups, false to disable. -*/ -void Adafruit_LSM6DS3::enableI2CMasterPullups(bool enable_pullups) { - Adafruit_BusIO_Register master_config = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS3_MASTER_CONFIG); - Adafruit_BusIO_RegisterBits i2c_master_pu_en = - Adafruit_BusIO_RegisterBits(&master_config, 1, 3); - - i2c_master_pu_en.write(enable_pullups); -} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3.h b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3.h deleted file mode 100644 index ddf3ad7..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3.h +++ /dev/null @@ -1,42 +0,0 @@ -/*! - * @file Adafruit_LSM6DS3.h - * - * I2C Driver for the Adafruit LSM6DS3 6-DoF Accelerometer and Gyroscope - *library - * - * This is a library for the Adafruit LSM6DS3 breakout: - * https://www.adafruit.com/ - * - * Adafruit invests time and resources providing this open source code, - * please support Adafruit and open-source hardware by purchasing products from - * Adafruit! - * - * - * BSD license (see license.txt) - */ - -#ifndef _ADAFRUIT_LSM6DS3_H -#define _ADAFRUIT_LSM6DS3_H - -#include "Adafruit_LSM6DS.h" - -#define LSM6DS3_CHIP_ID 0x69 ///< LSM6DS3 default device id from WHOAMI - -#define LSM6DS3_MASTER_CONFIG 0x1A ///< I2C Master config - -/*! - * @brief Class that stores state and functions for interacting with - * the LSM6DS3 - */ -class Adafruit_LSM6DS3 : public Adafruit_LSM6DS { -public: - Adafruit_LSM6DS3(); - ~Adafruit_LSM6DS3(){}; - - void enableI2CMasterPullups(bool enable_pullups); - -private: - bool _init(int32_t sensor_id); -}; - -#endif diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS33.cpp b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS33.cpp deleted file mode 100644 index 711b4cf..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS33.cpp +++ /dev/null @@ -1,40 +0,0 @@ - -/*! - * @file Adafruit_LSM6DS33.cpp Adafruit LSM6DS33 6-DoF Accelerometer - * and Gyroscope library - * - * Bryan Siepert for Adafruit Industries - * BSD (see license.txt) - */ - -#include "Arduino.h" -#include - -#include "Adafruit_LSM6DS33.h" - -/*! - * @brief Instantiates a new LSM6DS33 class - */ -Adafruit_LSM6DS33::Adafruit_LSM6DS33(void) {} - -bool Adafruit_LSM6DS33::_init(int32_t sensor_id) { - // make sure we're talking to the right chip - if (chipID() != LSM6DS33_CHIP_ID) { - return false; - } - _sensorid_accel = sensor_id; - _sensorid_gyro = sensor_id + 1; - _sensorid_temp = sensor_id + 2; - - temperature_sensitivity = 16.0; - - reset(); - if (chipID() != LSM6DS33_CHIP_ID) { - return false; - } - - // call base class _init() - Adafruit_LSM6DS::_init(sensor_id); - - return true; -} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS33.h b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS33.h deleted file mode 100644 index 9ca2e5e..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS33.h +++ /dev/null @@ -1,38 +0,0 @@ -/*! - * @file Adafruit_LSM6DS33.h - * - * I2C Driver for the Adafruit LSM6DS33 6-DoF Accelerometer and Gyroscope - *library - * - * This is a library for the Adafruit LSM6DS33 breakout: - * https://www.adafruit.com/products/4480 - * - * Adafruit invests time and resources providing this open source code, - * please support Adafruit and open-source hardware by purchasing products from - * Adafruit! - * - * - * BSD license (see license.txt) - */ - -#ifndef _ADAFRUIT_LSM6DS33_H -#define _ADAFRUIT_LSM6DS33_H - -#include "Adafruit_LSM6DS.h" - -#define LSM6DS33_CHIP_ID 0x69 ///< LSM6DS33 default device id from WHOAMI - -/*! - * @brief Class that stores state and functions for interacting with - * the LSM6DS33 I2C Digital Potentiometer - */ -class Adafruit_LSM6DS33 : public Adafruit_LSM6DS { -public: - Adafruit_LSM6DS33(); - ~Adafruit_LSM6DS33(){}; - -private: - bool _init(int32_t sensor_id); -}; - -#endif diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3TRC.cpp b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3TRC.cpp deleted file mode 100644 index 949a238..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3TRC.cpp +++ /dev/null @@ -1,71 +0,0 @@ - -/*! - * @file Adafruit_LSM6DS3TRC.cpp Adafruit LSM6DS3TR-C 6-DoF Accelerometer - * and Gyroscope library - * - * Written by ladyada for Adafruit Industries - * BSD (see license.txt) - */ - -#include "Arduino.h" -#include - -#include "Adafruit_LSM6DS3TRC.h" - -/*! - * @brief Instantiates a new LSM6DS3TRC class - */ -Adafruit_LSM6DS3TRC::Adafruit_LSM6DS3TRC(void) {} - -bool Adafruit_LSM6DS3TRC::_init(int32_t sensor_id) { - // make sure we're talking to the right chip - if (chipID() != LSM6DS3TRC_CHIP_ID) { - return false; - } - _sensorid_accel = sensor_id; - _sensorid_gyro = sensor_id + 1; - _sensorid_temp = sensor_id + 2; - - reset(); - - // call base class _init() - Adafruit_LSM6DS::_init(sensor_id); - - return true; -} - -/**************************************************************************/ -/*! - @brief Enables and disables the pedometer function - @param enable True to turn on the pedometer function, false to turn off -*/ -/**************************************************************************/ -void Adafruit_LSM6DS3TRC::enablePedometer(bool enable) { - // enable or disable functionality - Adafruit_BusIO_Register ctrl10 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL10_C); - - Adafruit_BusIO_RegisterBits ped_en = - Adafruit_BusIO_RegisterBits(&ctrl10, 1, 4); - ped_en.write(enable); - - Adafruit_BusIO_RegisterBits func_en = - Adafruit_BusIO_RegisterBits(&ctrl10, 1, 2); - func_en.write(enable); - - resetPedometer(); -} - -/**************************************************************************/ -/*! - @brief Enables and disables the I2C master bus pulllups. - @param enable_pullups true to enable the I2C pullups, false to disable. -*/ -void Adafruit_LSM6DS3TRC::enableI2CMasterPullups(bool enable_pullups) { - Adafruit_BusIO_Register master_config = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS3TRC_MASTER_CONFIG); - Adafruit_BusIO_RegisterBits i2c_master_pu_en = - Adafruit_BusIO_RegisterBits(&master_config, 1, 3); - - i2c_master_pu_en.write(enable_pullups); -} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3TRC.h b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3TRC.h deleted file mode 100644 index 68326ba..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DS3TRC.h +++ /dev/null @@ -1,43 +0,0 @@ -/*! - * @file Adafruit_LSM6DSL.h - * - * I2C Driver for the Adafruit LSM6DSL 6-DoF Accelerometer and Gyroscope - *library - * - * This is a library for the Adafruit LSM6DSL breakout: - * https://www.adafruit.com/ - * - * Adafruit invests time and resources providing this open source code, - * please support Adafruit and open-source hardware by purchasing products from - * Adafruit! - * - * - * BSD license (see license.txt) - */ - -#ifndef _ADAFRUIT_LSM6DS3TRC_H -#define _ADAFRUIT_LSM6DS3TRC_H - -#include "Adafruit_LSM6DS.h" - -#define LSM6DS3TRC_CHIP_ID 0x6A ///< LSM6DSL default device id from WHOAMI - -#define LSM6DS3TRC_MASTER_CONFIG 0x1A ///< I2C Master config - -/*! - * @brief Class that stores state and functions for interacting with - * the LSM6DS3TRC - */ -class Adafruit_LSM6DS3TRC : public Adafruit_LSM6DS { -public: - Adafruit_LSM6DS3TRC(); - ~Adafruit_LSM6DS3TRC(){}; - - void enableI2CMasterPullups(bool enable_pullups); - void enablePedometer(bool enable); - -private: - bool _init(int32_t sensor_id); -}; - -#endif diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSL.cpp b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSL.cpp deleted file mode 100644 index b751e9b..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSL.cpp +++ /dev/null @@ -1,49 +0,0 @@ - -/*! - * @file Adafruit_LSM6DSL.cpp Adafruit LSM6DSL 6-DoF Accelerometer - * and Gyroscope library - * - * Adapted by Eugene Anikin for Adafruit Industries - * BSD (see license.txt) - */ - -#include "Arduino.h" -#include - -#include "Adafruit_LSM6DSL.h" - -/*! - * @brief Instantiates a new LSM6DSL class - */ -Adafruit_LSM6DSL::Adafruit_LSM6DSL(void) {} - -bool Adafruit_LSM6DSL::_init(int32_t sensor_id) { - // make sure we're talking to the right chip - if (chipID() != LSM6DSL_CHIP_ID) { - return false; - } - _sensorid_accel = sensor_id; - _sensorid_gyro = sensor_id + 1; - _sensorid_temp = sensor_id + 2; - - reset(); - - // call base class _init() - Adafruit_LSM6DS::_init(sensor_id); - - return true; -} - -/**************************************************************************/ -/*! - @brief Enables and disables the I2C master bus pulllups. - @param enable_pullups true to enable the I2C pullups, false to disable. -*/ -void Adafruit_LSM6DSL::enableI2CMasterPullups(bool enable_pullups) { - Adafruit_BusIO_Register master_config = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DSL_MASTER_CONFIG); - Adafruit_BusIO_RegisterBits i2c_master_pu_en = - Adafruit_BusIO_RegisterBits(&master_config, 1, 3); - - i2c_master_pu_en.write(enable_pullups); -} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSL.h b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSL.h deleted file mode 100644 index 17649fd..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSL.h +++ /dev/null @@ -1,42 +0,0 @@ -/*! - * @file Adafruit_LSM6DSL.h - * - * I2C Driver for the Adafruit LSM6DSL 6-DoF Accelerometer and Gyroscope - *library - * - * This is a library for the Adafruit LSM6DSL breakout: - * https://www.adafruit.com/ - * - * Adafruit invests time and resources providing this open source code, - * please support Adafruit and open-source hardware by purchasing products from - * Adafruit! - * - * - * BSD license (see license.txt) - */ - -#ifndef _ADAFRUIT_LSM6DSL_H -#define _ADAFRUIT_LSM6DSL_H - -#include "Adafruit_LSM6DS.h" - -#define LSM6DSL_CHIP_ID 0x6A ///< LSM6DSL default device id from WHOAMI - -#define LSM6DSL_MASTER_CONFIG 0x1A ///< I2C Master config - -/*! - * @brief Class that stores state and functions for interacting with - * the LSM6DSL - */ -class Adafruit_LSM6DSL : public Adafruit_LSM6DS { -public: - Adafruit_LSM6DSL(); - ~Adafruit_LSM6DSL(){}; - - void enableI2CMasterPullups(bool enable_pullups); - -private: - bool _init(int32_t sensor_id); -}; - -#endif diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSO32.cpp b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSO32.cpp deleted file mode 100644 index bbf8d1b..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSO32.cpp +++ /dev/null @@ -1,143 +0,0 @@ - -/*! - * @file Adafruit_LSM6DSO32.cpp - * Adafruit LSM6DSO32 6-DoF Accelerometer and Gyroscope library - * - * Bryan Siepert for Adafruit Industries - * BSD (see license.txt) - */ - -#include "Arduino.h" -#include - -#include "Adafruit_LSM6DSO32.h" -#include "Adafruit_LSM6DSOX.h" - -/*! - * @brief Instantiates a new LSM6DSO32 class - */ -Adafruit_LSM6DSO32::Adafruit_LSM6DSO32(void) {} - -bool Adafruit_LSM6DSO32::_init(int32_t sensor_id) { - Adafruit_BusIO_Register chip_id = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_WHOAMI); - - // make sure we're talking to the right chip - if (chip_id.read() != LSM6DSO32_CHIP_ID) { - return false; - } - _sensorid_accel = sensor_id; - _sensorid_gyro = sensor_id + 1; - _sensorid_temp = sensor_id + 2; - - reset(); - - Adafruit_BusIO_Register ctrl3 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DSOX_CTRL3_C); - Adafruit_BusIO_RegisterBits bdu = Adafruit_BusIO_RegisterBits(&ctrl3, 1, 6); - bdu.write(true); - - // Disable I3C - Adafruit_BusIO_Register ctrl_9 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DSOX_CTRL9_XL); - Adafruit_BusIO_RegisterBits i3c_disable_bit = - Adafruit_BusIO_RegisterBits(&ctrl_9, 1, 1); - - i3c_disable_bit.write(true); - - // call base class _init() - Adafruit_LSM6DS::_init(sensor_id); - - return true; -} - -/******************* Adafruit_Sensor functions *****************/ -/*! - * @brief Updates the measurement data for all sensors simultaneously - */ -/**************************************************************************/ -// works for now, should refactor -void Adafruit_LSM6DSO32::_read(void) { - // get raw readings - Adafruit_BusIO_Register data_reg = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_OUT_TEMP_L, 14); - - uint8_t buffer[14]; - data_reg.read(buffer, 14); - - rawTemp = buffer[1] << 8 | buffer[0]; - temperature = (rawTemp / 256.0) + 25.0; - - rawGyroX = buffer[3] << 8 | buffer[2]; - rawGyroY = buffer[5] << 8 | buffer[4]; - rawGyroZ = buffer[7] << 8 | buffer[6]; - - rawAccX = buffer[9] << 8 | buffer[8]; - rawAccY = buffer[11] << 8 | buffer[10]; - rawAccZ = buffer[13] << 8 | buffer[12]; - - lsm6ds_gyro_range_t gyro_range = getGyroRange(); - float gyro_scale = 1; // range is in milli-dps per bit! - if (gyro_range == ISM330DHCX_GYRO_RANGE_4000_DPS) - gyro_scale = 140.0; - if (gyro_range == LSM6DS_GYRO_RANGE_2000_DPS) - gyro_scale = 70.0; - if (gyro_range == LSM6DS_GYRO_RANGE_1000_DPS) - gyro_scale = 35.0; - if (gyro_range == LSM6DS_GYRO_RANGE_500_DPS) - gyro_scale = 17.50; - if (gyro_range == LSM6DS_GYRO_RANGE_250_DPS) - gyro_scale = 8.75; - if (gyro_range == LSM6DS_GYRO_RANGE_125_DPS) - gyro_scale = 4.375; - - gyroX = rawGyroX * gyro_scale * SENSORS_DPS_TO_RADS / 1000.0; - gyroY = rawGyroY * gyro_scale * SENSORS_DPS_TO_RADS / 1000.0; - gyroZ = rawGyroZ * gyro_scale * SENSORS_DPS_TO_RADS / 1000.0; - - lsm6dso32_accel_range_t accel_range = getAccelRange(); - float accel_scale = 1; // range is in milli-g per bit! - if (accel_range == LSM6DSO32_ACCEL_RANGE_32_G) - accel_scale = 0.976; - if (accel_range == LSM6DSO32_ACCEL_RANGE_16_G) - accel_scale = 0.488; - if (accel_range == LSM6DSO32_ACCEL_RANGE_8_G) - accel_scale = 0.244; - if (accel_range == LSM6DSO32_ACCEL_RANGE_4_G) - accel_scale = 0.122; - accX = rawAccX * accel_scale * SENSORS_GRAVITY_STANDARD / 1000; - accY = rawAccY * accel_scale * SENSORS_GRAVITY_STANDARD / 1000; - accZ = rawAccZ * accel_scale * SENSORS_GRAVITY_STANDARD / 1000; -} - -/**************************************************************************/ -/*! - @brief Gets the accelerometer measurement range. - @returns The the accelerometer measurement range. -*/ -lsm6dso32_accel_range_t Adafruit_LSM6DSO32::getAccelRange(void) { - - Adafruit_BusIO_Register ctrl1 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL1_XL); - - Adafruit_BusIO_RegisterBits accel_range = - Adafruit_BusIO_RegisterBits(&ctrl1, 2, 2); - - return (lsm6dso32_accel_range_t)accel_range.read(); -} -/**************************************************************************/ -/*! - @brief Sets the accelerometer measurement range. - @param new_range The `lsm6dso32_accel_range_t` range to set. -*/ -void Adafruit_LSM6DSO32::setAccelRange(lsm6dso32_accel_range_t new_range) { - - Adafruit_BusIO_Register ctrl1 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_CTRL1_XL); - - Adafruit_BusIO_RegisterBits accel_range = - Adafruit_BusIO_RegisterBits(&ctrl1, 2, 2); - - accel_range.write(new_range); - delay(20); -} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSO32.h b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSO32.h deleted file mode 100644 index c0ecbd0..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSO32.h +++ /dev/null @@ -1,49 +0,0 @@ -/*! - * @file Adafruit_LSM6DSO32.h - * - * I2C Driver for the Adafruit LSM6DSO32 6-DoF Accelerometer and Gyroscope - *library - * - * This is a library for the Adafruit LSM6DSO32 breakout: - * https://www.adafruit.com/products/PID_HERE - * - * Adafruit invests time and resources providing this open source code, - * please support Adafruit and open-source hardware by purchasing products from - * Adafruit! - * - * - * BSD license (see license.txt) - */ - -#ifndef _ADAFRUIT_LSM6DSO32_H -#define _ADAFRUIT_LSM6DSO32_H - -#include "Adafruit_LSM6DS.h" -#include "Adafruit_LSM6DSOX.h" -#define LSM6DSO32_CHIP_ID 0x6C ///< LSM6DSO32 default device id from WHOAMI - -/** The accelerometer data range */ -typedef enum dso32_accel_range { - LSM6DSO32_ACCEL_RANGE_4_G, - LSM6DSO32_ACCEL_RANGE_32_G, - LSM6DSO32_ACCEL_RANGE_8_G, - LSM6DSO32_ACCEL_RANGE_16_G -} lsm6dso32_accel_range_t; - -/*! - * @brief Class that stores state and functions for interacting with - * the LSM6DSO32 I2C Digital Potentiometer - */ -class Adafruit_LSM6DSO32 : public Adafruit_LSM6DSOX { -public: - Adafruit_LSM6DSO32(); - - lsm6dso32_accel_range_t getAccelRange(void); - void setAccelRange(lsm6dso32_accel_range_t new_range); - void _read(void); - -private: - bool _init(int32_t sensor_id); -}; - -#endif diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSOX.cpp b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSOX.cpp deleted file mode 100644 index f739609..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSOX.cpp +++ /dev/null @@ -1,90 +0,0 @@ - -/*! - * @file Adafruit_LSM6DSOX.cpp - * Adafruit LSM6DSOX 6-DoF Accelerometer and Gyroscope library - * - * Bryan Siepert for Adafruit Industries - * BSD (see license.txt) - */ - -#include "Arduino.h" -#include - -#include "Adafruit_LSM6DSOX.h" - -/*! - * @brief Instantiates a new LSM6DSOX class - */ -Adafruit_LSM6DSOX::Adafruit_LSM6DSOX(void) {} - -bool Adafruit_LSM6DSOX::_init(int32_t sensor_id) { - Adafruit_BusIO_Register chip_id = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DS_WHOAMI); - - // make sure we're talking to the right chip - if (chip_id.read() != LSM6DSOX_CHIP_ID) { - return false; - } - _sensorid_accel = sensor_id; - _sensorid_gyro = sensor_id + 1; - _sensorid_temp = sensor_id + 2; - - reset(); - - // Block Data Update - Adafruit_BusIO_Register ctrl3 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DSOX_CTRL3_C); - Adafruit_BusIO_RegisterBits bdu = Adafruit_BusIO_RegisterBits(&ctrl3, 1, 6); - bdu.write(true); - - // Disable I3C - Adafruit_BusIO_Register ctrl_9 = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DSOX_CTRL9_XL); - Adafruit_BusIO_RegisterBits i3c_disable_bit = - Adafruit_BusIO_RegisterBits(&ctrl_9, 1, 1); - - i3c_disable_bit.write(true); - - // call base class _init() - Adafruit_LSM6DS::_init(sensor_id); - - return true; -} - -/**************************************************************************/ -/*! - @brief Disables and enables the SPI master bus pulllups. - @param disable_pullups true to **disable** the I2C pullups, false to enable. -*/ -void Adafruit_LSM6DSOX::disableSPIMasterPullups(bool disable_pullups) { - - Adafruit_BusIO_Register pin_config = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DSOX_PIN_CTRL); - - Adafruit_BusIO_RegisterBits disable_ois_pu = - Adafruit_BusIO_RegisterBits(&pin_config, 1, 7); - - disable_ois_pu.write(disable_pullups); -} - -/**************************************************************************/ -/*! - @brief Enables and disables the I2C master bus pulllups. - @param enable_pullups true to enable the I2C pullups, false to disable. -*/ -void Adafruit_LSM6DSOX::enableI2CMasterPullups(bool enable_pullups) { - - Adafruit_BusIO_Register func_cfg_access = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DSOX_FUNC_CFG_ACCESS); - Adafruit_BusIO_RegisterBits master_cfg_enable_bit = - Adafruit_BusIO_RegisterBits(&func_cfg_access, 1, 6); - - Adafruit_BusIO_Register master_config = Adafruit_BusIO_Register( - i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, LSM6DSOX_MASTER_CONFIG); - Adafruit_BusIO_RegisterBits i2c_master_pu_en = - Adafruit_BusIO_RegisterBits(&master_config, 1, 3); - - master_cfg_enable_bit.write(true); - i2c_master_pu_en.write(enable_pullups); - master_cfg_enable_bit.write(false); -} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSOX.h b/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSOX.h deleted file mode 100644 index d226dd7..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/Adafruit_LSM6DSOX.h +++ /dev/null @@ -1,53 +0,0 @@ -/*! - * @file Adafruit_LSM6DSOX.h - * - * I2C Driver for the Adafruit LSM6DSOX 6-DoF Accelerometer and Gyroscope - *library - * - * This is a library for the Adafruit LSM6DSOX breakout: - * https://www.adafruit.com/products/PID_HERE - * - * Adafruit invests time and resources providing this open source code, - * please support Adafruit and open-source hardware by purchasing products from - * Adafruit! - * - * - * BSD license (see license.txt) - */ - -#ifndef _ADAFRUIT_LSM6DSOX_H -#define _ADAFRUIT_LSM6DSOX_H - -#include "Adafruit_LSM6DS.h" - -#define LSM6DSOX_CHIP_ID 0x6C ///< LSM6DSOX default device id from WHOAMI - -#define LSM6DSOX_FUNC_CFG_ACCESS 0x1 ///< Enable embedded functions register -#define LSM6DSOX_PIN_CTRL 0x2 ///< Pin control register - -#define LSM6DSOX_INT1_CTRL 0x0D ///< Interrupt enable for data ready -#define LSM6DSOX_CTRL1_XL 0x10 ///< Main accelerometer config register -#define LSM6DSOX_CTRL2_G 0x11 ///< Main gyro config register -#define LSM6DSOX_CTRL3_C 0x12 ///< Main configuration register -#define LSM6DSOX_CTRL9_XL 0x18 ///< Includes i3c disable bit - -#define LSM6DSOX_MASTER_CONFIG 0x14 -///< I2C Master config; access must be enabled with bit SHUB_REG_ACCESS -///< is set to '1' in FUNC_CFG_ACCESS (01h). - -/*! - * @brief Class that stores state and functions for interacting with - * the LSM6DSOX I2C Digital Potentiometer - */ -class Adafruit_LSM6DSOX : public Adafruit_LSM6DS { -public: - Adafruit_LSM6DSOX(); - - void enableI2CMasterPullups(bool enable_pullups); - void disableSPIMasterPullups(bool disable_pullups); - -private: - bool _init(int32_t sensor_id); -}; - -#endif diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/README.md b/.pio/libdeps/teensy41/Adafruit LSM6DS/README.md deleted file mode 100644 index 30a6dfe..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# Adafruit LSM6DS ![Build Status](https://github.com/adafruit/Adafruit_LSM6DS/workflows/Arduino%20Library%20CI/badge.svg) - -This is the Adafruit LSM6DS 6-DoF Accelerometer and Gyroscope Sensor Library for Arduino - -Tested and works great with the Adafruit LSM6DSOX Breakout Board -[](https://www.adafruit.com/products/4438) - - -This chip uses I2C to communicate, 2 pins are required to interface - -Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! - -# Dependencies -* [Adafruit_BusIO](https://github.com/adafruit/Adafruit_BusIO) -* [Adafruit_Sensor](https://github.com/adafruit/Adafruit_Sensor) - -# Contributing - -Contributions are welcome! Please read our [Code of Conduct](https://github.com/adafruit/Adafruit_LSM6DSOX/blob/master/CODE_OF_CONDUCT.md>) -before contributing to help this project stay welcoming. - -## Documentation and doxygen -Documentation is produced by doxygen. Contributions should include documentation for any new code added. - -Some examples of how to use doxygen can be found in these guide pages: - -https://learn.adafruit.com/the-well-automated-arduino-library/doxygen - -https://learn.adafruit.com/the-well-automated-arduino-library/doxygen-tips - -Written by Bryan Siepert for Adafruit Industries. -BSD license, check license.txt for more information -All text above must be included in any redistribution - -To install, use the Arduino Library Manager and search for "Adafruit LSM6DS" and install the library. diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/code-of-conduct.md b/.pio/libdeps/teensy41/Adafruit LSM6DS/code-of-conduct.md deleted file mode 100644 index 8ee6e44..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/code-of-conduct.md +++ /dev/null @@ -1,127 +0,0 @@ -# Adafruit Community Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and leaders pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level or type of -experience, education, socio-economic status, nationality, personal appearance, -race, religion, or sexual identity and orientation. - -## Our Standards - -We are committed to providing a friendly, safe and welcoming environment for -all. - -Examples of behavior that contributes to creating a positive environment -include: - -* Be kind and courteous to others -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Collaborating with other community members -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and sexual attention or advances -* The use of inappropriate images, including in a community member's avatar -* The use of inappropriate language, including in a community member's nickname -* Any spamming, flaming, baiting or other attention-stealing behavior -* Excessive or unwelcome helping; answering outside the scope of the question - asked -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate - -The goal of the standards and moderation guidelines outlined here is to build -and maintain a respectful community. We ask that you don’t just aim to be -"technically unimpeachable", but rather try to be your best self. - -We value many things beyond technical expertise, including collaboration and -supporting others within our community. Providing a positive experience for -other community members can have a much more significant impact than simply -providing the correct answer. - -## Our Responsibilities - -Project leaders are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project leaders have the right and responsibility to remove, edit, or -reject messages, comments, commits, code, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any community member for other behaviors that they deem -inappropriate, threatening, offensive, or harmful. - -## Moderation - -Instances of behaviors that violate the Adafruit Community Code of Conduct -may be reported by any member of the community. Community members are -encouraged to report these situations, including situations they witness -involving other community members. - -You may report in the following ways: - -In any situation, you may send an email to . - -On the Adafruit Discord, you may send an open message from any channel -to all Community Helpers by tagging @community helpers. You may also send an -open message from any channel, or a direct message to @kattni#1507, -@tannewt#4653, @Dan Halbert#1614, @cater#2442, @sommersoft#0222, or -@Andon#8175. - -Email and direct message reports will be kept confidential. - -In situations on Discord where the issue is particularly egregious, possibly -illegal, requires immediate action, or violates the Discord terms of service, -you should also report the message directly to Discord. - -These are the steps for upholding our community’s standards of conduct. - -1. Any member of the community may report any situation that violates the -Adafruit Community Code of Conduct. All reports will be reviewed and -investigated. -2. If the behavior is an egregious violation, the community member who -committed the violation may be banned immediately, without warning. -3. Otherwise, moderators will first respond to such behavior with a warning. -4. Moderators follow a soft "three strikes" policy - the community member may -be given another chance, if they are receptive to the warning and change their -behavior. -5. If the community member is unreceptive or unreasonable when warned by a -moderator, or the warning goes unheeded, they may be banned for a first or -second offense. Repeated offenses will result in the community member being -banned. - -## Scope - -This Code of Conduct and the enforcement policies listed above apply to all -Adafruit Community venues. This includes but is not limited to any community -spaces (both public and private), the entire Adafruit Discord server, and -Adafruit GitHub repositories. Examples of Adafruit Community spaces include -but are not limited to meet-ups, audio chats on the Adafruit Discord, or -interaction at a conference. - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. As a community -member, you are representing our community, and are expected to behave -accordingly. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 1.4, available at -, -and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html). - -For other projects adopting the Adafruit Community Code of -Conduct, please contact the maintainers of those projects for enforcement. -If you wish to use this code of conduct for your own project, consider -explicitly mentioning your moderation policy or making a copy with your -own moderation policy so as to avoid confusion. diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_ism330dhcx_test/adafruit_ism330dhcx_test.ino b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_ism330dhcx_test/adafruit_ism330dhcx_test.ino deleted file mode 100644 index 63db406..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_ism330dhcx_test/adafruit_ism330dhcx_test.ino +++ /dev/null @@ -1,198 +0,0 @@ -// Basic demo for accelerometer/gyro readings from Adafruit ISM330DHCX - -#include - -// For SPI mode, we need a CS pin -#define LSM_CS 10 -// For software-SPI mode we need SCK/MOSI/MISO pins -#define LSM_SCK 13 -#define LSM_MISO 12 -#define LSM_MOSI 11 - -Adafruit_ISM330DHCX ism330dhcx; -void setup(void) { - Serial.begin(115200); - while (!Serial) - delay(10); // will pause Zero, Leonardo, etc until serial console opens - - Serial.println("Adafruit ISM330DHCX test!"); - - if (!ism330dhcx.begin_I2C()) { - // if (!ism330dhcx.begin_SPI(LSM_CS)) { - // if (!ism330dhcx.begin_SPI(LSM_CS, LSM_SCK, LSM_MISO, LSM_MOSI)) { - Serial.println("Failed to find ISM330DHCX chip"); - while (1) { - delay(10); - } - } - - Serial.println("ISM330DHCX Found!"); - - // ism330dhcx.setAccelRange(LSM6DS_ACCEL_RANGE_2_G); - Serial.print("Accelerometer range set to: "); - switch (ism330dhcx.getAccelRange()) { - case LSM6DS_ACCEL_RANGE_2_G: - Serial.println("+-2G"); - break; - case LSM6DS_ACCEL_RANGE_4_G: - Serial.println("+-4G"); - break; - case LSM6DS_ACCEL_RANGE_8_G: - Serial.println("+-8G"); - break; - case LSM6DS_ACCEL_RANGE_16_G: - Serial.println("+-16G"); - break; - } - - // ism330dhcx.setGyroRange(LSM6DS_GYRO_RANGE_250_DPS); - Serial.print("Gyro range set to: "); - switch (ism330dhcx.getGyroRange()) { - case LSM6DS_GYRO_RANGE_125_DPS: - Serial.println("125 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_250_DPS: - Serial.println("250 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_500_DPS: - Serial.println("500 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_1000_DPS: - Serial.println("1000 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_2000_DPS: - Serial.println("2000 degrees/s"); - break; - case ISM330DHCX_GYRO_RANGE_4000_DPS: - Serial.println("4000 degrees/s"); - break; - } - - // ism330dhcx.setAccelDataRate(LSM6DS_RATE_12_5_HZ); - Serial.print("Accelerometer data rate set to: "); - switch (ism330dhcx.getAccelDataRate()) { - case LSM6DS_RATE_SHUTDOWN: - Serial.println("0 Hz"); - break; - case LSM6DS_RATE_12_5_HZ: - Serial.println("12.5 Hz"); - break; - case LSM6DS_RATE_26_HZ: - Serial.println("26 Hz"); - break; - case LSM6DS_RATE_52_HZ: - Serial.println("52 Hz"); - break; - case LSM6DS_RATE_104_HZ: - Serial.println("104 Hz"); - break; - case LSM6DS_RATE_208_HZ: - Serial.println("208 Hz"); - break; - case LSM6DS_RATE_416_HZ: - Serial.println("416 Hz"); - break; - case LSM6DS_RATE_833_HZ: - Serial.println("833 Hz"); - break; - case LSM6DS_RATE_1_66K_HZ: - Serial.println("1.66 KHz"); - break; - case LSM6DS_RATE_3_33K_HZ: - Serial.println("3.33 KHz"); - break; - case LSM6DS_RATE_6_66K_HZ: - Serial.println("6.66 KHz"); - break; - } - - // ism330dhcx.setGyroDataRate(LSM6DS_RATE_12_5_HZ); - Serial.print("Gyro data rate set to: "); - switch (ism330dhcx.getGyroDataRate()) { - case LSM6DS_RATE_SHUTDOWN: - Serial.println("0 Hz"); - break; - case LSM6DS_RATE_12_5_HZ: - Serial.println("12.5 Hz"); - break; - case LSM6DS_RATE_26_HZ: - Serial.println("26 Hz"); - break; - case LSM6DS_RATE_52_HZ: - Serial.println("52 Hz"); - break; - case LSM6DS_RATE_104_HZ: - Serial.println("104 Hz"); - break; - case LSM6DS_RATE_208_HZ: - Serial.println("208 Hz"); - break; - case LSM6DS_RATE_416_HZ: - Serial.println("416 Hz"); - break; - case LSM6DS_RATE_833_HZ: - Serial.println("833 Hz"); - break; - case LSM6DS_RATE_1_66K_HZ: - Serial.println("1.66 KHz"); - break; - case LSM6DS_RATE_3_33K_HZ: - Serial.println("3.33 KHz"); - break; - case LSM6DS_RATE_6_66K_HZ: - Serial.println("6.66 KHz"); - break; - } - - ism330dhcx.configInt1(false, false, true); // accelerometer DRDY on INT1 - ism330dhcx.configInt2(false, true, false); // gyro DRDY on INT2 -} - -void loop() { - // /* Get a new normalized sensor event */ - sensors_event_t accel; - sensors_event_t gyro; - sensors_event_t temp; - ism330dhcx.getEvent(&accel, &gyro, &temp); - - Serial.print("\t\tTemperature "); - Serial.print(temp.temperature); - Serial.println(" deg C"); - - /* Display the results (acceleration is measured in m/s^2) */ - Serial.print("\t\tAccel X: "); - Serial.print(accel.acceleration.x); - Serial.print(" \tY: "); - Serial.print(accel.acceleration.y); - Serial.print(" \tZ: "); - Serial.print(accel.acceleration.z); - Serial.println(" m/s^2 "); - - /* Display the results (rotation is measured in rad/s) */ - Serial.print("\t\tGyro X: "); - Serial.print(gyro.gyro.x); - Serial.print(" \tY: "); - Serial.print(gyro.gyro.y); - Serial.print(" \tZ: "); - Serial.print(gyro.gyro.z); - Serial.println(" radians/s "); - Serial.println(); - - delay(100); - - // // serial plotter friendly format - - // Serial.print(temp.temperature); - // Serial.print(","); - - // Serial.print(accel.acceleration.x); - // Serial.print(","); Serial.print(accel.acceleration.y); - // Serial.print(","); Serial.print(accel.acceleration.z); - // Serial.print(","); - - // Serial.print(gyro.gyro.x); - // Serial.print(","); Serial.print(gyro.gyro.y); - // Serial.print(","); Serial.print(gyro.gyro.z); - // Serial.println(); - // delayMicroseconds(10000); -} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds33_test/adafruit_lsm6ds33_test.ino b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds33_test/adafruit_lsm6ds33_test.ino deleted file mode 100644 index b8ac3df..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds33_test/adafruit_lsm6ds33_test.ino +++ /dev/null @@ -1,197 +0,0 @@ -// Basic demo for accelerometer/gyro readings from Adafruit LSM6DS33 - -#include - -// For SPI mode, we need a CS pin -#define LSM_CS 10 -// For software-SPI mode we need SCK/MOSI/MISO pins -#define LSM_SCK 13 -#define LSM_MISO 12 -#define LSM_MOSI 11 - -Adafruit_LSM6DS33 lsm6ds33; -void setup(void) { - Serial.begin(115200); - while (!Serial) - delay(10); // will pause Zero, Leonardo, etc until serial console opens - - Serial.println("Adafruit LSM6DS33 test!"); - - if (!lsm6ds33.begin_I2C()) { - // if (!lsm6ds33.begin_SPI(LSM_CS)) { - // if (!lsm6ds33.begin_SPI(LSM_CS, LSM_SCK, LSM_MISO, LSM_MOSI)) { - Serial.println("Failed to find LSM6DS33 chip"); - while (1) { - delay(10); - } - } - - Serial.println("LSM6DS33 Found!"); - - // lsm6ds33.setAccelRange(LSM6DS_ACCEL_RANGE_2_G); - Serial.print("Accelerometer range set to: "); - switch (lsm6ds33.getAccelRange()) { - case LSM6DS_ACCEL_RANGE_2_G: - Serial.println("+-2G"); - break; - case LSM6DS_ACCEL_RANGE_4_G: - Serial.println("+-4G"); - break; - case LSM6DS_ACCEL_RANGE_8_G: - Serial.println("+-8G"); - break; - case LSM6DS_ACCEL_RANGE_16_G: - Serial.println("+-16G"); - break; - } - - // lsm6ds33.setGyroRange(LSM6DS_GYRO_RANGE_250_DPS); - Serial.print("Gyro range set to: "); - switch (lsm6ds33.getGyroRange()) { - case LSM6DS_GYRO_RANGE_125_DPS: - Serial.println("125 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_250_DPS: - Serial.println("250 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_500_DPS: - Serial.println("500 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_1000_DPS: - Serial.println("1000 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_2000_DPS: - Serial.println("2000 degrees/s"); - break; - case ISM330DHCX_GYRO_RANGE_4000_DPS: - break; // unsupported range for the DS33 - } - - // lsm6ds33.setAccelDataRate(LSM6DS_RATE_12_5_HZ); - Serial.print("Accelerometer data rate set to: "); - switch (lsm6ds33.getAccelDataRate()) { - case LSM6DS_RATE_SHUTDOWN: - Serial.println("0 Hz"); - break; - case LSM6DS_RATE_12_5_HZ: - Serial.println("12.5 Hz"); - break; - case LSM6DS_RATE_26_HZ: - Serial.println("26 Hz"); - break; - case LSM6DS_RATE_52_HZ: - Serial.println("52 Hz"); - break; - case LSM6DS_RATE_104_HZ: - Serial.println("104 Hz"); - break; - case LSM6DS_RATE_208_HZ: - Serial.println("208 Hz"); - break; - case LSM6DS_RATE_416_HZ: - Serial.println("416 Hz"); - break; - case LSM6DS_RATE_833_HZ: - Serial.println("833 Hz"); - break; - case LSM6DS_RATE_1_66K_HZ: - Serial.println("1.66 KHz"); - break; - case LSM6DS_RATE_3_33K_HZ: - Serial.println("3.33 KHz"); - break; - case LSM6DS_RATE_6_66K_HZ: - Serial.println("6.66 KHz"); - break; - } - - // lsm6ds33.setGyroDataRate(LSM6DS_RATE_12_5_HZ); - Serial.print("Gyro data rate set to: "); - switch (lsm6ds33.getGyroDataRate()) { - case LSM6DS_RATE_SHUTDOWN: - Serial.println("0 Hz"); - break; - case LSM6DS_RATE_12_5_HZ: - Serial.println("12.5 Hz"); - break; - case LSM6DS_RATE_26_HZ: - Serial.println("26 Hz"); - break; - case LSM6DS_RATE_52_HZ: - Serial.println("52 Hz"); - break; - case LSM6DS_RATE_104_HZ: - Serial.println("104 Hz"); - break; - case LSM6DS_RATE_208_HZ: - Serial.println("208 Hz"); - break; - case LSM6DS_RATE_416_HZ: - Serial.println("416 Hz"); - break; - case LSM6DS_RATE_833_HZ: - Serial.println("833 Hz"); - break; - case LSM6DS_RATE_1_66K_HZ: - Serial.println("1.66 KHz"); - break; - case LSM6DS_RATE_3_33K_HZ: - Serial.println("3.33 KHz"); - break; - case LSM6DS_RATE_6_66K_HZ: - Serial.println("6.66 KHz"); - break; - } - - lsm6ds33.configInt1(false, false, true); // accelerometer DRDY on INT1 - lsm6ds33.configInt2(false, true, false); // gyro DRDY on INT2 -} - -void loop() { - // /* Get a new normalized sensor event */ - sensors_event_t accel; - sensors_event_t gyro; - sensors_event_t temp; - lsm6ds33.getEvent(&accel, &gyro, &temp); - - Serial.print("\t\tTemperature "); - Serial.print(temp.temperature); - Serial.println(" deg C"); - - /* Display the results (acceleration is measured in m/s^2) */ - Serial.print("\t\tAccel X: "); - Serial.print(accel.acceleration.x); - Serial.print(" \tY: "); - Serial.print(accel.acceleration.y); - Serial.print(" \tZ: "); - Serial.print(accel.acceleration.z); - Serial.println(" m/s^2 "); - - /* Display the results (rotation is measured in rad/s) */ - Serial.print("\t\tGyro X: "); - Serial.print(gyro.gyro.x); - Serial.print(" \tY: "); - Serial.print(gyro.gyro.y); - Serial.print(" \tZ: "); - Serial.print(gyro.gyro.z); - Serial.println(" radians/s "); - Serial.println(); - - delay(100); - - // // serial plotter friendly format - - // Serial.print(temp.temperature); - // Serial.print(","); - - // Serial.print(accel.acceleration.x); - // Serial.print(","); Serial.print(accel.acceleration.y); - // Serial.print(","); Serial.print(accel.acceleration.z); - // Serial.print(","); - - // Serial.print(gyro.gyro.x); - // Serial.print(","); Serial.print(gyro.gyro.y); - // Serial.print(","); Serial.print(gyro.gyro.z); - // Serial.println(); - // delayMicroseconds(10000); -} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds3trc_test/adafruit_lsm6ds3trc_test.ino b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds3trc_test/adafruit_lsm6ds3trc_test.ino deleted file mode 100644 index 420ac97..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds3trc_test/adafruit_lsm6ds3trc_test.ino +++ /dev/null @@ -1,198 +0,0 @@ -// Basic demo for accelerometer/gyro readings from Adafruit LSM6DS3TR-C - -#include - -// For SPI mode, we need a CS pin -#define LSM_CS 10 -// For software-SPI mode we need SCK/MOSI/MISO pins -#define LSM_SCK 13 -#define LSM_MISO 12 -#define LSM_MOSI 11 - -Adafruit_LSM6DS3TRC lsm6ds3trc; - -void setup(void) { - Serial.begin(115200); - while (!Serial) - delay(10); // will pause Zero, Leonardo, etc until serial console opens - - Serial.println("Adafruit LSM6DS3TR-C test!"); - - if (!lsm6ds3trc.begin_I2C()) { - // if (!lsm6ds3trc.begin_SPI(LSM_CS)) { - // if (!lsm6ds3trc.begin_SPI(LSM_CS, LSM_SCK, LSM_MISO, LSM_MOSI)) { - Serial.println("Failed to find LSM6DS3TR-C chip"); - while (1) { - delay(10); - } - } - - Serial.println("LSM6DS3TR-C Found!"); - - // lsm6ds3trc.setAccelRange(LSM6DS_ACCEL_RANGE_2_G); - Serial.print("Accelerometer range set to: "); - switch (lsm6ds3trc.getAccelRange()) { - case LSM6DS_ACCEL_RANGE_2_G: - Serial.println("+-2G"); - break; - case LSM6DS_ACCEL_RANGE_4_G: - Serial.println("+-4G"); - break; - case LSM6DS_ACCEL_RANGE_8_G: - Serial.println("+-8G"); - break; - case LSM6DS_ACCEL_RANGE_16_G: - Serial.println("+-16G"); - break; - } - - // lsm6ds3trc.setGyroRange(LSM6DS_GYRO_RANGE_250_DPS); - Serial.print("Gyro range set to: "); - switch (lsm6ds3trc.getGyroRange()) { - case LSM6DS_GYRO_RANGE_125_DPS: - Serial.println("125 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_250_DPS: - Serial.println("250 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_500_DPS: - Serial.println("500 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_1000_DPS: - Serial.println("1000 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_2000_DPS: - Serial.println("2000 degrees/s"); - break; - case ISM330DHCX_GYRO_RANGE_4000_DPS: - break; // unsupported range for the DS33 - } - - // lsm6ds3trc.setAccelDataRate(LSM6DS_RATE_12_5_HZ); - Serial.print("Accelerometer data rate set to: "); - switch (lsm6ds3trc.getAccelDataRate()) { - case LSM6DS_RATE_SHUTDOWN: - Serial.println("0 Hz"); - break; - case LSM6DS_RATE_12_5_HZ: - Serial.println("12.5 Hz"); - break; - case LSM6DS_RATE_26_HZ: - Serial.println("26 Hz"); - break; - case LSM6DS_RATE_52_HZ: - Serial.println("52 Hz"); - break; - case LSM6DS_RATE_104_HZ: - Serial.println("104 Hz"); - break; - case LSM6DS_RATE_208_HZ: - Serial.println("208 Hz"); - break; - case LSM6DS_RATE_416_HZ: - Serial.println("416 Hz"); - break; - case LSM6DS_RATE_833_HZ: - Serial.println("833 Hz"); - break; - case LSM6DS_RATE_1_66K_HZ: - Serial.println("1.66 KHz"); - break; - case LSM6DS_RATE_3_33K_HZ: - Serial.println("3.33 KHz"); - break; - case LSM6DS_RATE_6_66K_HZ: - Serial.println("6.66 KHz"); - break; - } - - // lsm6ds3trc.setGyroDataRate(LSM6DS_RATE_12_5_HZ); - Serial.print("Gyro data rate set to: "); - switch (lsm6ds3trc.getGyroDataRate()) { - case LSM6DS_RATE_SHUTDOWN: - Serial.println("0 Hz"); - break; - case LSM6DS_RATE_12_5_HZ: - Serial.println("12.5 Hz"); - break; - case LSM6DS_RATE_26_HZ: - Serial.println("26 Hz"); - break; - case LSM6DS_RATE_52_HZ: - Serial.println("52 Hz"); - break; - case LSM6DS_RATE_104_HZ: - Serial.println("104 Hz"); - break; - case LSM6DS_RATE_208_HZ: - Serial.println("208 Hz"); - break; - case LSM6DS_RATE_416_HZ: - Serial.println("416 Hz"); - break; - case LSM6DS_RATE_833_HZ: - Serial.println("833 Hz"); - break; - case LSM6DS_RATE_1_66K_HZ: - Serial.println("1.66 KHz"); - break; - case LSM6DS_RATE_3_33K_HZ: - Serial.println("3.33 KHz"); - break; - case LSM6DS_RATE_6_66K_HZ: - Serial.println("6.66 KHz"); - break; - } - - lsm6ds3trc.configInt1(false, false, true); // accelerometer DRDY on INT1 - lsm6ds3trc.configInt2(false, true, false); // gyro DRDY on INT2 -} - -void loop() { - // Get a new normalized sensor event - sensors_event_t accel; - sensors_event_t gyro; - sensors_event_t temp; - lsm6ds3trc.getEvent(&accel, &gyro, &temp); - - Serial.print("\t\tTemperature "); - Serial.print(temp.temperature); - Serial.println(" deg C"); - - /* Display the results (acceleration is measured in m/s^2) */ - Serial.print("\t\tAccel X: "); - Serial.print(accel.acceleration.x); - Serial.print(" \tY: "); - Serial.print(accel.acceleration.y); - Serial.print(" \tZ: "); - Serial.print(accel.acceleration.z); - Serial.println(" m/s^2 "); - - /* Display the results (rotation is measured in rad/s) */ - Serial.print("\t\tGyro X: "); - Serial.print(gyro.gyro.x); - Serial.print(" \tY: "); - Serial.print(gyro.gyro.y); - Serial.print(" \tZ: "); - Serial.print(gyro.gyro.z); - Serial.println(" radians/s "); - Serial.println(); - - delay(100); - - // // serial plotter friendly format - - // Serial.print(temp.temperature); - // Serial.print(","); - - // Serial.print(accel.acceleration.x); - // Serial.print(","); Serial.print(accel.acceleration.y); - // Serial.print(","); Serial.print(accel.acceleration.z); - // Serial.print(","); - - // Serial.print(gyro.gyro.x); - // Serial.print(","); Serial.print(gyro.gyro.y); - // Serial.print(","); Serial.print(gyro.gyro.z); - // Serial.println(); - // delayMicroseconds(10000); -} diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_pedometer/adafruit_lsm6ds_pedometer.ino b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_pedometer/adafruit_lsm6ds_pedometer.ino deleted file mode 100644 index 1cfc25e..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_pedometer/adafruit_lsm6ds_pedometer.ino +++ /dev/null @@ -1,52 +0,0 @@ -// Basic demo for accelerometer/gyro readings from Adafruit LSM6DS33 - -#include -#include - -Adafruit_LSM6DS33 lsm; // can use any LSM6DS/ISM330 family chip! -//Adafruit_LSM6DS3TRC lsm; // uncomment to use LSM6DS3TR-C - -// For SPI mode, we need a CS pin -#define LSM_CS 10 -// For software-SPI mode we need SCK/MOSI/MISO pins -#define LSM_SCK 13 -#define LSM_MISO 12 -#define LSM_MOSI 11 - - -void setup(void) { - Serial.begin(115200); - while (!Serial) - delay(10); // will pause Zero, Leonardo, etc until serial console opens - - Serial.println("Adafruit LSM6DS pedometer test!"); - - if (!lsm.begin_I2C()) { - // if (!lsm.begin_SPI(LSM_CS)) { - // if (!lsm.begin_SPI(LSM_CS, LSM_SCK, LSM_MISO, LSM_MOSI)) { - Serial.println("Failed to find LSM6DS chip"); - while (1) { - delay(10); - } - } - - Serial.println("LSM6DS Found!"); - - // Set to 2G range and 26 Hz update rate - lsm.setAccelRange(LSM6DS_ACCEL_RANGE_2_G); - lsm.setGyroRange(LSM6DS_GYRO_RANGE_250_DPS); - lsm.setAccelDataRate(LSM6DS_RATE_26_HZ); - lsm.setGyroDataRate(LSM6DS_RATE_26_HZ); - - // step detect output on INT1 - lsm.configInt1(false, false, false, true); - - // turn it on! - Serial.println("Enable ped"); - lsm.enablePedometer(true); -} - -void loop() { - Serial.print("Steps taken: "); Serial.println(lsm.readPedometer()); - delay(100); // can wait as long as you like! -} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_shake/adafruit_lsm6ds_shake.ino b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_shake/adafruit_lsm6ds_shake.ino deleted file mode 100644 index 58eaeaa..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_shake/adafruit_lsm6ds_shake.ino +++ /dev/null @@ -1,44 +0,0 @@ -// Basic demo for accelerometer/gyro readings from Adafruit LSM6DS33 - -#include -#include - -// For SPI mode, we need a CS pin -#define LSM_CS 10 -// For software-SPI mode we need SCK/MOSI/MISO pins -#define LSM_SCK 13 -#define LSM_MISO 12 -#define LSM_MOSI 11 - - -Adafruit_LSM6DS33 lsm6ds; // uncomment to use LSM6DS33 -//Adafruit_LSM6DS3TRC lsm6ds; // uncomment to use LSM6DS3TR-C - -void setup(void) { - Serial.begin(115200); - while (!Serial) - delay(10); // will pause Zero, Leonardo, etc until serial console opens - - Serial.println("Adafruit LSM6DS shake test!"); - - if (!lsm6ds.begin_I2C()) { - // if (!lsm6ds.begin_SPI(LSM_CS)) { - // if (!lsm6ds.begin_SPI(LSM_CS, LSM_SCK, LSM_MISO, LSM_MOSI)) { - Serial.println("Failed to find LSM6DS chip"); - while (1) { - delay(10); - } - } - - Serial.println("LSM6DS Found!"); - - // enable shake detection - lsm6ds.enableWakeup(true); -} - -void loop() { - // check for shake - if (lsm6ds.shake()) { - Serial.println("SHAKE!"); - } -} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_unifiedsensors/adafruit_lsm6ds_unifiedsensors.ino b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_unifiedsensors/adafruit_lsm6ds_unifiedsensors.ino deleted file mode 100644 index cf0ea1b..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6ds_unifiedsensors/adafruit_lsm6ds_unifiedsensors.ino +++ /dev/null @@ -1,85 +0,0 @@ -// Demo for getting individual unified sensor data from the LSM6DS series - -// Can change this to be LSM6DSOX or whatever ya like -#include -#include - -Adafruit_LSM6DS33 lsm6ds; // can use any LSM6DS/ISM330 family chip! -//Adafruit_LSM6DS3TRC lsm6ds; // uncomment to use LSM6DS3TR-C -Adafruit_Sensor *lsm_temp, *lsm_accel, *lsm_gyro; - -void setup(void) { - Serial.begin(115200); - while (!Serial) - delay(10); // will pause Zero, Leonardo, etc until serial console opens - - Serial.println("Adafruit LSM6DS test!"); - - if (!lsm6ds.begin_I2C()) { - Serial.println("Failed to find LSM6DS chip"); - while (1) { - delay(10); - } - } - - Serial.println("LSM6DS Found!"); - lsm_temp = lsm6ds.getTemperatureSensor(); - lsm_temp->printSensorDetails(); - - lsm_accel = lsm6ds.getAccelerometerSensor(); - lsm_accel->printSensorDetails(); - - lsm_gyro = lsm6ds.getGyroSensor(); - lsm_gyro->printSensorDetails(); -} - -void loop() { - // /* Get a new normalized sensor event */ - sensors_event_t accel; - sensors_event_t gyro; - sensors_event_t temp; - lsm_temp->getEvent(&temp); - lsm_accel->getEvent(&accel); - lsm_gyro->getEvent(&gyro); - - Serial.print("\t\tTemperature "); - Serial.print(temp.temperature); - Serial.println(" deg C"); - - /* Display the results (acceleration is measured in m/s^2) */ - Serial.print("\t\tAccel X: "); - Serial.print(accel.acceleration.x); - Serial.print(" \tY: "); - Serial.print(accel.acceleration.y); - Serial.print(" \tZ: "); - Serial.print(accel.acceleration.z); - Serial.println(" m/s^2 "); - - /* Display the results (rotation is measured in rad/s) */ - Serial.print("\t\tGyro X: "); - Serial.print(gyro.gyro.x); - Serial.print(" \tY: "); - Serial.print(gyro.gyro.y); - Serial.print(" \tZ: "); - Serial.print(gyro.gyro.z); - Serial.println(" radians/s "); - Serial.println(); - - delay(100); - - /* serial plotter friendly format - Serial.print(temp.temperature); - Serial.print(","); - - Serial.print(accel.acceleration.x); - Serial.print(","); Serial.print(accel.acceleration.y); - Serial.print(","); Serial.print(accel.acceleration.z); - Serial.print(","); - - Serial.print(gyro.gyro.x); - Serial.print(","); Serial.print(gyro.gyro.y); - Serial.print(","); Serial.print(gyro.gyro.z); - Serial.println(); - delay(10); - */ -} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6dso32_test/adafruit_lsm6dso32_test.ino b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6dso32_test/adafruit_lsm6dso32_test.ino deleted file mode 100644 index 17baedd..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6dso32_test/adafruit_lsm6dso32_test.ino +++ /dev/null @@ -1,196 +0,0 @@ -// Basic demo for accelerometer & gyro readings from Adafruit -// LSM6DSO32 sensor - -#include - -// For SPI mode, we need a CS pin -#define LSM_CS 10 -// For software-SPI mode we need SCK/MOSI/MISO pins -#define LSM_SCK 13 -#define LSM_MISO 12 -#define LSM_MOSI 11 - -Adafruit_LSM6DSO32 dso32; -void setup(void) { - Serial.begin(115200); - while (!Serial) - delay(10); // will pause Zero, Leonardo, etc until serial console opens - - Serial.println("Adafruit LSM6DSO32 test!"); - - if (!dso32.begin_I2C()) { - // if (!dso32.begin_SPI(LSM_CS)) { - // if (!dso32.begin_SPI(LSM_CS, LSM_SCK, LSM_MISO, LSM_MOSI)) { - // Serial.println("Failed to find LSM6DSO32 chip"); - while (1) { - delay(10); - } - } - - Serial.println("LSM6DSO32 Found!"); - - dso32.setAccelRange(LSM6DSO32_ACCEL_RANGE_8_G); - Serial.print("Accelerometer range set to: "); - switch (dso32.getAccelRange()) { - case LSM6DSO32_ACCEL_RANGE_4_G: - Serial.println("+-4G"); - break; - case LSM6DSO32_ACCEL_RANGE_8_G: - Serial.println("+-8G"); - break; - case LSM6DSO32_ACCEL_RANGE_16_G: - Serial.println("+-16G"); - break; - case LSM6DSO32_ACCEL_RANGE_32_G: - Serial.println("+-32G"); - break; - } - - // dso32.setGyroRange(LSM6DS_GYRO_RANGE_250_DPS ); - Serial.print("Gyro range set to: "); - switch (dso32.getGyroRange()) { - case LSM6DS_GYRO_RANGE_125_DPS: - Serial.println("125 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_250_DPS: - Serial.println("250 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_500_DPS: - Serial.println("500 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_1000_DPS: - Serial.println("1000 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_2000_DPS: - Serial.println("2000 degrees/s"); - break; - case ISM330DHCX_GYRO_RANGE_4000_DPS: - break; // unsupported range for the DSO32 - } - - // dso32.setAccelDataRate(LSM6DS_RATE_12_5_HZ); - Serial.print("Accelerometer data rate set to: "); - switch (dso32.getAccelDataRate()) { - case LSM6DS_RATE_SHUTDOWN: - Serial.println("0 Hz"); - break; - case LSM6DS_RATE_12_5_HZ: - Serial.println("12.5 Hz"); - break; - case LSM6DS_RATE_26_HZ: - Serial.println("26 Hz"); - break; - case LSM6DS_RATE_52_HZ: - Serial.println("52 Hz"); - break; - case LSM6DS_RATE_104_HZ: - Serial.println("104 Hz"); - break; - case LSM6DS_RATE_208_HZ: - Serial.println("208 Hz"); - break; - case LSM6DS_RATE_416_HZ: - Serial.println("416 Hz"); - break; - case LSM6DS_RATE_833_HZ: - Serial.println("833 Hz"); - break; - case LSM6DS_RATE_1_66K_HZ: - Serial.println("1.66 KHz"); - break; - case LSM6DS_RATE_3_33K_HZ: - Serial.println("3.33 KHz"); - break; - case LSM6DS_RATE_6_66K_HZ: - Serial.println("6.66 KHz"); - break; - } - - // dso32.setGyroDataRate(LSM6DS_RATE_12_5_HZ); - Serial.print("Gyro data rate set to: "); - switch (dso32.getGyroDataRate()) { - case LSM6DS_RATE_SHUTDOWN: - Serial.println("0 Hz"); - break; - case LSM6DS_RATE_12_5_HZ: - Serial.println("12.5 Hz"); - break; - case LSM6DS_RATE_26_HZ: - Serial.println("26 Hz"); - break; - case LSM6DS_RATE_52_HZ: - Serial.println("52 Hz"); - break; - case LSM6DS_RATE_104_HZ: - Serial.println("104 Hz"); - break; - case LSM6DS_RATE_208_HZ: - Serial.println("208 Hz"); - break; - case LSM6DS_RATE_416_HZ: - Serial.println("416 Hz"); - break; - case LSM6DS_RATE_833_HZ: - Serial.println("833 Hz"); - break; - case LSM6DS_RATE_1_66K_HZ: - Serial.println("1.66 KHz"); - break; - case LSM6DS_RATE_3_33K_HZ: - Serial.println("3.33 KHz"); - break; - case LSM6DS_RATE_6_66K_HZ: - Serial.println("6.66 KHz"); - break; - } -} - -void loop() { - - // /* Get a new normalized sensor event */ - sensors_event_t accel; - sensors_event_t gyro; - sensors_event_t temp; - dso32.getEvent(&accel, &gyro, &temp); - - Serial.print("\t\tTemperature "); - Serial.print(temp.temperature); - Serial.println(" deg C"); - - /* Display the results (acceleration is measured in m/s^2) */ - Serial.print("\t\tAccel X: "); - Serial.print(accel.acceleration.x); - Serial.print(" \tY: "); - Serial.print(accel.acceleration.y); - Serial.print(" \tZ: "); - Serial.print(accel.acceleration.z); - Serial.println(" m/s^2 "); - - /* Display the results (rotation is measured in rad/s) */ - Serial.print("\t\tGyro X: "); - Serial.print(gyro.gyro.x); - Serial.print(" \tY: "); - Serial.print(gyro.gyro.y); - Serial.print(" \tZ: "); - Serial.print(gyro.gyro.z); - Serial.println(" radians/s "); - Serial.println(); - - delay(100); - - // // serial plotter friendly format - - // Serial.print(temp.temperature); - // Serial.print(","); - - // Serial.print(accel.acceleration.x); - // Serial.print(","); Serial.print(accel.acceleration.y); - // Serial.print(","); Serial.print(accel.acceleration.z); - // Serial.print(","); - - // Serial.print(gyro.gyro.x); - // Serial.print(","); Serial.print(gyro.gyro.y); - // Serial.print(","); Serial.print(gyro.gyro.z); - // Serial.println(); - // delayMicroseconds(10000); -} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6dsox_test/adafruit_lsm6dsox_test.ino b/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6dsox_test/adafruit_lsm6dsox_test.ino deleted file mode 100644 index 0dd1396..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/examples/adafruit_lsm6dsox_test/adafruit_lsm6dsox_test.ino +++ /dev/null @@ -1,196 +0,0 @@ -// Basic demo for accelerometer & gyro readings from Adafruit -// LSM6DSOX sensor - -#include - -// For SPI mode, we need a CS pin -#define LSM_CS 10 -// For software-SPI mode we need SCK/MOSI/MISO pins -#define LSM_SCK 13 -#define LSM_MISO 12 -#define LSM_MOSI 11 - -Adafruit_LSM6DSOX sox; -void setup(void) { - Serial.begin(115200); - while (!Serial) - delay(10); // will pause Zero, Leonardo, etc until serial console opens - - Serial.println("Adafruit LSM6DSOX test!"); - - if (!sox.begin_I2C()) { - // if (!sox.begin_SPI(LSM_CS)) { - // if (!sox.begin_SPI(LSM_CS, LSM_SCK, LSM_MISO, LSM_MOSI)) { - // Serial.println("Failed to find LSM6DSOX chip"); - while (1) { - delay(10); - } - } - - Serial.println("LSM6DSOX Found!"); - - // sox.setAccelRange(LSM6DS_ACCEL_RANGE_2_G); - Serial.print("Accelerometer range set to: "); - switch (sox.getAccelRange()) { - case LSM6DS_ACCEL_RANGE_2_G: - Serial.println("+-2G"); - break; - case LSM6DS_ACCEL_RANGE_4_G: - Serial.println("+-4G"); - break; - case LSM6DS_ACCEL_RANGE_8_G: - Serial.println("+-8G"); - break; - case LSM6DS_ACCEL_RANGE_16_G: - Serial.println("+-16G"); - break; - } - - // sox.setGyroRange(LSM6DS_GYRO_RANGE_250_DPS ); - Serial.print("Gyro range set to: "); - switch (sox.getGyroRange()) { - case LSM6DS_GYRO_RANGE_125_DPS: - Serial.println("125 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_250_DPS: - Serial.println("250 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_500_DPS: - Serial.println("500 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_1000_DPS: - Serial.println("1000 degrees/s"); - break; - case LSM6DS_GYRO_RANGE_2000_DPS: - Serial.println("2000 degrees/s"); - break; - case ISM330DHCX_GYRO_RANGE_4000_DPS: - break; // unsupported range for the DSOX - } - - // sox.setAccelDataRate(LSM6DS_RATE_12_5_HZ); - Serial.print("Accelerometer data rate set to: "); - switch (sox.getAccelDataRate()) { - case LSM6DS_RATE_SHUTDOWN: - Serial.println("0 Hz"); - break; - case LSM6DS_RATE_12_5_HZ: - Serial.println("12.5 Hz"); - break; - case LSM6DS_RATE_26_HZ: - Serial.println("26 Hz"); - break; - case LSM6DS_RATE_52_HZ: - Serial.println("52 Hz"); - break; - case LSM6DS_RATE_104_HZ: - Serial.println("104 Hz"); - break; - case LSM6DS_RATE_208_HZ: - Serial.println("208 Hz"); - break; - case LSM6DS_RATE_416_HZ: - Serial.println("416 Hz"); - break; - case LSM6DS_RATE_833_HZ: - Serial.println("833 Hz"); - break; - case LSM6DS_RATE_1_66K_HZ: - Serial.println("1.66 KHz"); - break; - case LSM6DS_RATE_3_33K_HZ: - Serial.println("3.33 KHz"); - break; - case LSM6DS_RATE_6_66K_HZ: - Serial.println("6.66 KHz"); - break; - } - - // sox.setGyroDataRate(LSM6DS_RATE_12_5_HZ); - Serial.print("Gyro data rate set to: "); - switch (sox.getGyroDataRate()) { - case LSM6DS_RATE_SHUTDOWN: - Serial.println("0 Hz"); - break; - case LSM6DS_RATE_12_5_HZ: - Serial.println("12.5 Hz"); - break; - case LSM6DS_RATE_26_HZ: - Serial.println("26 Hz"); - break; - case LSM6DS_RATE_52_HZ: - Serial.println("52 Hz"); - break; - case LSM6DS_RATE_104_HZ: - Serial.println("104 Hz"); - break; - case LSM6DS_RATE_208_HZ: - Serial.println("208 Hz"); - break; - case LSM6DS_RATE_416_HZ: - Serial.println("416 Hz"); - break; - case LSM6DS_RATE_833_HZ: - Serial.println("833 Hz"); - break; - case LSM6DS_RATE_1_66K_HZ: - Serial.println("1.66 KHz"); - break; - case LSM6DS_RATE_3_33K_HZ: - Serial.println("3.33 KHz"); - break; - case LSM6DS_RATE_6_66K_HZ: - Serial.println("6.66 KHz"); - break; - } -} - -void loop() { - - // /* Get a new normalized sensor event */ - sensors_event_t accel; - sensors_event_t gyro; - sensors_event_t temp; - sox.getEvent(&accel, &gyro, &temp); - - Serial.print("\t\tTemperature "); - Serial.print(temp.temperature); - Serial.println(" deg C"); - - /* Display the results (acceleration is measured in m/s^2) */ - Serial.print("\t\tAccel X: "); - Serial.print(accel.acceleration.x); - Serial.print(" \tY: "); - Serial.print(accel.acceleration.y); - Serial.print(" \tZ: "); - Serial.print(accel.acceleration.z); - Serial.println(" m/s^2 "); - - /* Display the results (rotation is measured in rad/s) */ - Serial.print("\t\tGyro X: "); - Serial.print(gyro.gyro.x); - Serial.print(" \tY: "); - Serial.print(gyro.gyro.y); - Serial.print(" \tZ: "); - Serial.print(gyro.gyro.z); - Serial.println(" radians/s "); - Serial.println(); - - delay(100); - - // // serial plotter friendly format - - // Serial.print(temp.temperature); - // Serial.print(","); - - // Serial.print(accel.acceleration.x); - // Serial.print(","); Serial.print(accel.acceleration.y); - // Serial.print(","); Serial.print(accel.acceleration.z); - // Serial.print(","); - - // Serial.print(gyro.gyro.x); - // Serial.print(","); Serial.print(gyro.gyro.y); - // Serial.print(","); Serial.print(gyro.gyro.z); - // Serial.println(); - // delayMicroseconds(10000); -} \ No newline at end of file diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/library.properties b/.pio/libdeps/teensy41/Adafruit LSM6DS/library.properties deleted file mode 100644 index 1706aff..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/library.properties +++ /dev/null @@ -1,10 +0,0 @@ -name=Adafruit LSM6DS -version=4.7.0 -author=Adafruit -maintainer=Adafruit -sentence=Arduino library for the LSM6DS sensors in the Adafruit shop -paragraph=Arduino library for the LSM6DS sensors in the Adafruit shop -category=Sensors -url=https://github.com/adafruit/Adafruit_LSM6DS -architectures=* -depends=Adafruit Unified Sensor, Adafruit BusIO diff --git a/.pio/libdeps/teensy41/Adafruit LSM6DS/license.txt b/.pio/libdeps/teensy41/Adafruit LSM6DS/license.txt deleted file mode 100644 index bc90c68..0000000 --- a/.pio/libdeps/teensy41/Adafruit LSM6DS/license.txt +++ /dev/null @@ -1,26 +0,0 @@ -Software License Agreement (BSD License) - -Copyright (c) 2019 Bryan Siepert for Adafruit Industries -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. -3. Neither the name of the copyright holders nor the -names of its contributors may be used to endorse or promote products -derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.pio/libdeps/teensy41/Adafruit Unified Sensor/.gitignore b/.pio/libdeps/teensy41/Adafruit Unified Sensor/.gitignore deleted file mode 100644 index d04184a..0000000 --- a/.pio/libdeps/teensy41/Adafruit Unified Sensor/.gitignore +++ /dev/null @@ -1,108 +0,0 @@ -# -# NOTE! Don't add files that are generated in specific -# subdirectories here. Add them in the ".gitignore" file -# in that subdirectory instead. -# -# NOTE! Please use 'git ls-files -i --exclude-standard' -# command after changing this file, to see if there are -# any tracked files which get ignored after the change. -# -# Normal rules -# -.* -*.o -*.o.* -*.a -*.s -*.ko -*.so -*.so.dbg -*.mod.c -*.i -*.lst -*.symtypes -*.order -modules.builtin -*.elf -*.bin -*.gz -*.bz2 -*.lzma -*.patch -*.gcno - -# -# Top-level generic files -# -/tags -/TAGS -/linux -/vmlinux -/vmlinuz -/System.map -/Module.markers -/Module.symvers - -# -# git files that we don't want to ignore even it they are dot-files -# -!.gitignore -!.mailmap - -# -# Generated include files -# -include/config -include/linux/version.h -include/generated - -# stgit generated dirs -patches-* - -# quilt's files -patches -series - -# cscope files -cscope.* -ncscope.* - -# gnu global files -GPATH -GRTAGS -GSYMS -GTAGS - -# QT-Creator files -Makefile.am.user -*.config -*.creator -*.creator.user -*.files -*.includes - -*.orig -*~ -\#*# -*.lo -*.la -Makefile -Makefile.in -aclocal.m4 -autoconfig.h -autoconfig.h.in -autom4te.cache/ -build-aux/ -config.log -config.status -configure -libtool -libupnp.pc -m4/libtool.m4 -m4/ltoptions.m4 -m4/ltsugar.m4 -m4/ltversion.m4 -m4/lt~obsolete.m4 -stamp-h1 -docs/doxygen - diff --git a/.pio/libdeps/teensy41/Adafruit Unified Sensor/Adafruit_Sensor.cpp b/.pio/libdeps/teensy41/Adafruit Unified Sensor/Adafruit_Sensor.cpp deleted file mode 100644 index b854a5a..0000000 --- a/.pio/libdeps/teensy41/Adafruit Unified Sensor/Adafruit_Sensor.cpp +++ /dev/null @@ -1,120 +0,0 @@ -#include "Adafruit_Sensor.h" - -/**************************************************************************/ -/*! - @brief Prints sensor information to serial console -*/ -/**************************************************************************/ -void Adafruit_Sensor::printSensorDetails(void) { - sensor_t sensor; - getSensor(&sensor); - Serial.println(F("------------------------------------")); - Serial.print(F("Sensor: ")); - Serial.println(sensor.name); - Serial.print(F("Type: ")); - switch ((sensors_type_t)sensor.type) { - case SENSOR_TYPE_ACCELEROMETER: - Serial.print(F("Acceleration (m/s2)")); - break; - case SENSOR_TYPE_MAGNETIC_FIELD: - Serial.print(F("Magnetic (uT)")); - break; - case SENSOR_TYPE_ORIENTATION: - Serial.print(F("Orientation (degrees)")); - break; - case SENSOR_TYPE_GYROSCOPE: - Serial.print(F("Gyroscopic (rad/s)")); - break; - case SENSOR_TYPE_LIGHT: - Serial.print(F("Light (lux)")); - break; - case SENSOR_TYPE_PRESSURE: - Serial.print(F("Pressure (hPa)")); - break; - case SENSOR_TYPE_PROXIMITY: - Serial.print(F("Distance (cm)")); - break; - case SENSOR_TYPE_GRAVITY: - Serial.print(F("Gravity (m/s2)")); - break; - case SENSOR_TYPE_LINEAR_ACCELERATION: - Serial.print(F("Linear Acceleration (m/s2)")); - break; - case SENSOR_TYPE_ROTATION_VECTOR: - Serial.print(F("Rotation vector")); - break; - case SENSOR_TYPE_RELATIVE_HUMIDITY: - Serial.print(F("Relative Humidity (%)")); - break; - case SENSOR_TYPE_AMBIENT_TEMPERATURE: - Serial.print(F("Ambient Temp (C)")); - break; - case SENSOR_TYPE_OBJECT_TEMPERATURE: - Serial.print(F("Object Temp (C)")); - break; - case SENSOR_TYPE_VOLTAGE: - Serial.print(F("Voltage (V)")); - break; - case SENSOR_TYPE_CURRENT: - Serial.print(F("Current (mA)")); - break; - case SENSOR_TYPE_COLOR: - Serial.print(F("Color (RGBA)")); - break; - case SENSOR_TYPE_TVOC: - Serial.print(F("Total Volatile Organic Compounds (ppb)")); - break; - case SENSOR_TYPE_VOC_INDEX: - Serial.print(F("Volatile Organic Compounds (Index)")); - break; - case SENSOR_TYPE_NOX_INDEX: - Serial.print(F("Nitrogen Oxides (Index)")); - break; - case SENSOR_TYPE_CO2: - Serial.print(F("Carbon Dioxide (ppm)")); - break; - case SENSOR_TYPE_ECO2: - Serial.print(F("Equivalent/estimated CO2 (ppm)")); - break; - case SENSOR_TYPE_PM10_STD: - Serial.print(F("Standard Particulate Matter 1.0 (ppm)")); - break; - case SENSOR_TYPE_PM25_STD: - Serial.print(F("Standard Particulate Matter 2.5 (ppm)")); - break; - case SENSOR_TYPE_PM100_STD: - Serial.print(F("Standard Particulate Matter 10.0 (ppm)")); - break; - case SENSOR_TYPE_PM10_ENV: - Serial.print(F("Environmental Particulate Matter 1.0 (ppm)")); - break; - case SENSOR_TYPE_PM25_ENV: - Serial.print(F("Environmental Particulate Matter 2.5 (ppm)")); - break; - case SENSOR_TYPE_PM100_ENV: - Serial.print(F("Environmental Particulate Matter 10.0 (ppm)")); - break; - case SENSOR_TYPE_GAS_RESISTANCE: - Serial.print(F("Gas Resistance (ohms)")); - break; - case SENSOR_TYPE_UNITLESS_PERCENT: - Serial.print(F("Unitless Percent (%)")); - break; - case SENSOR_TYPE_ALTITUDE: - Serial.print(F("Altitude (m)")); - break; - } - - Serial.println(); - Serial.print(F("Driver Ver: ")); - Serial.println(sensor.version); - Serial.print(F("Unique ID: ")); - Serial.println(sensor.sensor_id); - Serial.print(F("Min Value: ")); - Serial.println(sensor.min_value); - Serial.print(F("Max Value: ")); - Serial.println(sensor.max_value); - Serial.print(F("Resolution: ")); - Serial.println(sensor.resolution); - Serial.println(F("------------------------------------\n")); -} diff --git a/.pio/libdeps/teensy41/Adafruit Unified Sensor/Adafruit_Sensor.h b/.pio/libdeps/teensy41/Adafruit Unified Sensor/Adafruit_Sensor.h deleted file mode 100644 index 8c6a07d..0000000 --- a/.pio/libdeps/teensy41/Adafruit Unified Sensor/Adafruit_Sensor.h +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software< /span> - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* Update by K. Townsend (Adafruit Industries) for lighter typedefs, and - * extended sensor support to include color, voltage and current */ - -#ifndef _ADAFRUIT_SENSOR_H -#define _ADAFRUIT_SENSOR_H - -#ifndef ARDUINO -#include -#elif ARDUINO >= 100 -#include "Arduino.h" -#include "Print.h" -#else -#include "WProgram.h" -#endif - -/* Constants */ -#define SENSORS_GRAVITY_EARTH (9.80665F) /**< Earth's gravity in m/s^2 */ -#define SENSORS_GRAVITY_MOON (1.6F) /**< The moon's gravity in m/s^2 */ -#define SENSORS_GRAVITY_SUN (275.0F) /**< The sun's gravity in m/s^2 */ -#define SENSORS_GRAVITY_STANDARD (SENSORS_GRAVITY_EARTH) -#define SENSORS_MAGFIELD_EARTH_MAX \ - (60.0F) /**< Maximum magnetic field on Earth's surface */ -#define SENSORS_MAGFIELD_EARTH_MIN \ - (30.0F) /**< Minimum magnetic field on Earth's surface */ -#define SENSORS_PRESSURE_SEALEVELHPA \ - (1013.25F) /**< Average sea level pressure is 1013.25 hPa */ -#define SENSORS_DPS_TO_RADS \ - (0.017453293F) /**< Degrees/s to rad/s multiplier \ - */ -#define SENSORS_RADS_TO_DPS \ - (57.29577793F) /**< Rad/s to degrees/s multiplier */ -#define SENSORS_GAUSS_TO_MICROTESLA \ - (100) /**< Gauss to micro-Tesla multiplier */ - -/** Sensor types */ -typedef enum { - SENSOR_TYPE_ACCELEROMETER = (1), /**< Gravity + linear acceleration */ - SENSOR_TYPE_MAGNETIC_FIELD = (2), - SENSOR_TYPE_ORIENTATION = (3), - SENSOR_TYPE_GYROSCOPE = (4), - SENSOR_TYPE_LIGHT = (5), - SENSOR_TYPE_PRESSURE = (6), - SENSOR_TYPE_PROXIMITY = (8), - SENSOR_TYPE_GRAVITY = (9), - SENSOR_TYPE_LINEAR_ACCELERATION = - (10), /**< Acceleration not including gravity */ - SENSOR_TYPE_ROTATION_VECTOR = (11), - SENSOR_TYPE_RELATIVE_HUMIDITY = (12), - SENSOR_TYPE_AMBIENT_TEMPERATURE = (13), - SENSOR_TYPE_OBJECT_TEMPERATURE = (14), - SENSOR_TYPE_VOLTAGE = (15), - SENSOR_TYPE_CURRENT = (16), - SENSOR_TYPE_COLOR = (17), - SENSOR_TYPE_TVOC = (18), - SENSOR_TYPE_VOC_INDEX = (19), - SENSOR_TYPE_NOX_INDEX = (20), - SENSOR_TYPE_CO2 = (21), - SENSOR_TYPE_ECO2 = (22), - SENSOR_TYPE_PM10_STD = (23), - SENSOR_TYPE_PM25_STD = (24), - SENSOR_TYPE_PM100_STD = (25), - SENSOR_TYPE_PM10_ENV = (26), - SENSOR_TYPE_PM25_ENV = (27), - SENSOR_TYPE_PM100_ENV = (28), - SENSOR_TYPE_GAS_RESISTANCE = (29), - SENSOR_TYPE_UNITLESS_PERCENT = (30), - SENSOR_TYPE_ALTITUDE = (31) -} sensors_type_t; - -/** struct sensors_vec_s is used to return a vector in a common format. */ -typedef struct { - union { - float v[3]; ///< 3D vector elements - struct { - float x; ///< X component of vector - float y; ///< Y component of vector - float z; ///< Z component of vector - }; ///< Struct for holding XYZ component - /* Orientation sensors */ - struct { - float roll; /**< Rotation around the longitudinal axis (the plane body, 'X - axis'). Roll is positive and increasing when moving - downward. -90 degrees <= roll <= 90 degrees */ - float pitch; /**< Rotation around the lateral axis (the wing span, 'Y - axis'). Pitch is positive and increasing when moving - upwards. -180 degrees <= pitch <= 180 degrees) */ - float heading; /**< Angle between the longitudinal axis (the plane body) - and magnetic north, measured clockwise when viewing from - the top of the device. 0-359 degrees */ - }; ///< Struct for holding roll/pitch/heading - }; ///< Union that can hold 3D vector array, XYZ components or - ///< roll/pitch/heading - int8_t status; ///< Status byte - uint8_t reserved[3]; ///< Reserved -} sensors_vec_t; - -/** struct sensors_color_s is used to return color data in a common format. */ -typedef struct { - union { - float c[3]; ///< Raw 3-element data - /* RGB color space */ - struct { - float r; /**< Red component */ - float g; /**< Green component */ - float b; /**< Blue component */ - }; ///< RGB data in floating point notation - }; ///< Union of various ways to describe RGB colorspace - uint32_t rgba; /**< 24-bit RGBA value */ -} sensors_color_t; - -/* Sensor event (36 bytes) */ -/** struct sensor_event_s is used to provide a single sensor event in a common - * format. */ -typedef struct { - int32_t version; /**< must be sizeof(struct sensors_event_t) */ - int32_t sensor_id; /**< unique sensor identifier */ - int32_t type; /**< sensor type */ - int32_t reserved0; /**< reserved */ - int32_t timestamp; /**< time is in milliseconds */ - union { - float data[4]; ///< Raw data */ - sensors_vec_t acceleration; /**< acceleration values are in meter per second - per second (m/s^2) */ - sensors_vec_t - magnetic; /**< magnetic vector values are in micro-Tesla (uT) */ - sensors_vec_t orientation; /**< orientation values are in degrees */ - sensors_vec_t gyro; /**< gyroscope values are in rad/s */ - float temperature; /**< temperature is in degrees centigrade (Celsius) */ - float distance; /**< distance in centimeters */ - float light; /**< light in SI lux units */ - float pressure; /**< pressure in hectopascal (hPa) */ - float relative_humidity; /**< relative humidity in percent */ - float current; /**< current in milliamps (mA) */ - float voltage; /**< voltage in volts (V) */ - float tvoc; /**< Total Volatile Organic Compounds, in ppb */ - float voc_index; /**< VOC (Volatile Organic Compound) index where 100 is - normal (unitless) */ - float nox_index; /**< NOx (Nitrogen Oxides) index where 100 is normal - (unitless) */ - float CO2; /**< Measured CO2 in parts per million (ppm) */ - float eCO2; /**< equivalent/estimated CO2 in parts per million (ppm - estimated from some other measurement) */ - float pm10_std; /**< Standard Particulate Matter <=1.0 in parts per million - (ppm) */ - float pm25_std; /**< Standard Particulate Matter <=2.5 in parts per million - (ppm) */ - float pm100_std; /**< Standard Particulate Matter <=10.0 in parts per - million (ppm) */ - float pm10_env; /**< Environmental Particulate Matter <=1.0 in parts per - million (ppm) */ - float pm25_env; /**< Environmental Particulate Matter <=2.5 in parts per - million (ppm) */ - float pm100_env; /**< Environmental Particulate Matter <=10.0 in parts per - million (ppm) */ - float gas_resistance; /**< Proportional to the amount of VOC particles in - the air (Ohms) */ - float unitless_percent; /** -#include -#include - -/* Assign a unique ID to this sensor at the same time */ -/* Uncomment following line for default Wire bus */ -Adafruit_ADXL343 accel = Adafruit_ADXL343(12345); - -/* NeoTrellis M4, etc. */ -/* Uncomment following line for Wire1 bus */ -//Adafruit_ADXL343 accel = Adafruit_ADXL343(12345, &Wire1); - -void displaySensorDetails(void) -{ - sensor_t sensor; - accel.getSensor(&sensor); - Serial.println("------------------------------------"); - Serial.print ("Sensor: "); Serial.println(sensor.name); - Serial.print ("Driver Ver: "); Serial.println(sensor.version); - Serial.print ("Unique ID: "); Serial.println(sensor.sensor_id); - Serial.print ("Max Value: "); Serial.print(sensor.max_value); Serial.println(" m/s^2"); - Serial.print ("Min Value: "); Serial.print(sensor.min_value); Serial.println(" m/s^2"); - Serial.print ("Resolution: "); Serial.print(sensor.resolution); Serial.println(" m/s^2"); - Serial.println("------------------------------------"); - Serial.println(""); - delay(500); -} - -void displayDataRate(void) -{ - Serial.print ("Data Rate: "); - - switch(accel.getDataRate()) - { - case ADXL343_DATARATE_3200_HZ: - Serial.print ("3200 "); - break; - case ADXL343_DATARATE_1600_HZ: - Serial.print ("1600 "); - break; - case ADXL343_DATARATE_800_HZ: - Serial.print ("800 "); - break; - case ADXL343_DATARATE_400_HZ: - Serial.print ("400 "); - break; - case ADXL343_DATARATE_200_HZ: - Serial.print ("200 "); - break; - case ADXL343_DATARATE_100_HZ: - Serial.print ("100 "); - break; - case ADXL343_DATARATE_50_HZ: - Serial.print ("50 "); - break; - case ADXL343_DATARATE_25_HZ: - Serial.print ("25 "); - break; - case ADXL343_DATARATE_12_5_HZ: - Serial.print ("12.5 "); - break; - case ADXL343_DATARATE_6_25HZ: - Serial.print ("6.25 "); - break; - case ADXL343_DATARATE_3_13_HZ: - Serial.print ("3.13 "); - break; - case ADXL343_DATARATE_1_56_HZ: - Serial.print ("1.56 "); - break; - case ADXL343_DATARATE_0_78_HZ: - Serial.print ("0.78 "); - break; - case ADXL343_DATARATE_0_39_HZ: - Serial.print ("0.39 "); - break; - case ADXL343_DATARATE_0_20_HZ: - Serial.print ("0.20 "); - break; - case ADXL343_DATARATE_0_10_HZ: - Serial.print ("0.10 "); - break; - default: - Serial.print ("???? "); - break; - } - Serial.println(" Hz"); -} - -void displayRange(void) -{ - Serial.print ("Range: +/- "); - - switch(accel.getRange()) - { - case ADXL343_RANGE_16_G: - Serial.print ("16 "); - break; - case ADXL343_RANGE_8_G: - Serial.print ("8 "); - break; - case ADXL343_RANGE_4_G: - Serial.print ("4 "); - break; - case ADXL343_RANGE_2_G: - Serial.print ("2 "); - break; - default: - Serial.print ("?? "); - break; - } - Serial.println(" g"); -} - -void setup(void) -{ - Serial.begin(9600); - while (!Serial); - Serial.println("Accelerometer Test"); Serial.println(""); - - /* Initialise the sensor */ - if(!accel.begin()) - { - /* There was a problem detecting the ADXL343 ... check your connections */ - Serial.println("Ooops, no ADXL343 detected ... Check your wiring!"); - while(1); - } - - /* Set the range to whatever is appropriate for your project */ - accel.setRange(ADXL343_RANGE_16_G); - // accel.setRange(ADXL343_RANGE_8_G); - // accel.setRange(ADXL343_RANGE_4_G); - // accel.setRange(ADXL343_RANGE_2_G); - - /* Display some basic information on this sensor */ - displaySensorDetails(); - displayDataRate(); - displayRange(); - Serial.println(""); -} - -void loop(void) -{ - /* Get a new sensor event */ - sensors_event_t event; - accel.getEvent(&event); - - /* Display the results (acceleration is measured in m/s^2) */ - Serial.print("X: "); Serial.print(event.acceleration.x); Serial.print(" "); - Serial.print("Y: "); Serial.print(event.acceleration.y); Serial.print(" "); - Serial.print("Z: "); Serial.print(event.acceleration.z); Serial.print(" ");Serial.println("m/s^2 "); - delay(500); -} diff --git a/.pio/libdeps/teensy41/Adafruit Unified Sensor/library.properties b/.pio/libdeps/teensy41/Adafruit Unified Sensor/library.properties deleted file mode 100644 index 96a6670..0000000 --- a/.pio/libdeps/teensy41/Adafruit Unified Sensor/library.properties +++ /dev/null @@ -1,11 +0,0 @@ -name=Adafruit Unified Sensor -version=1.1.13 -author=Adafruit -maintainer=Adafruit -sentence=Required for all Adafruit Unified Sensor based libraries. -paragraph=A unified sensor abstraction layer used by many Adafruit sensor libraries. -category=Sensors -url=https://github.com/adafruit/Adafruit_Sensor -architectures=* -includes=Adafruit_Sensor.h - diff --git a/.pio/libdeps/teensy41/integrity.dat b/.pio/libdeps/teensy41/integrity.dat deleted file mode 100644 index 0389e63..0000000 --- a/.pio/libdeps/teensy41/integrity.dat +++ /dev/null @@ -1 +0,0 @@ -adafruit/Adafruit LSM6DS@^4.7.0 \ No newline at end of file diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json deleted file mode 100644 index ea991f3..0000000 --- a/.vscode/c_cpp_properties.json +++ /dev/null @@ -1,253 +0,0 @@ -// -// !!! WARNING !!! AUTO-GENERATED FILE! -// PLEASE DO NOT MODIFY IT AND USE "platformio.ini": -// https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags -// -{ - "configurations": [ - { - "name": "PlatformIO", - "includePath": [ - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/include", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/src", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit LSM6DS", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/cores/teensy4", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit BusIO", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit Unified Sensor", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPI", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ADC", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AccelStepper/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_NeoPixel", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_STMPE610", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_VS1053", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AltSoftSerial", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Artnet", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce2/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CapacitiveSensor", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CryptoAccel/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DS1307RTC", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DmxSimple", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DogLcd", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EEPROM", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransfer/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransferI2C/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Entropy", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ethernet/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FNET/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastCRC", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastLED/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN_T4", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexIO_t4/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexiTimer2", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqCount", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasure", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasureMulti", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FrequencyTimer2", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9341_t3", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9488_t3/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/IRremote/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Keypad/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedControl/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedDisplay", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystal/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystalFast", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LittleFS/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LowPower", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MFRC522/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MIDI/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Metro", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MsTimer2", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NativeEthernet/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OSC", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OctoWS2811", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OneWire", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PWMServo", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ping", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PulsePosition", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/QuadEncoder", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RA8875/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RadioHead", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ResponsiveAnalogRead/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SD/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPIFlash", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ST7735_t3/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SdFat/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SerialFlash", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Servo", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ShiftPWM", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Snooze/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftPWM", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftwareSerial", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TFT_ILI9163C", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Talkie", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TeensyThreads", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Time", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimeAlarms", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerOne", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerThree", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TinyGPS", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Tlc5940", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TouchScreen", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/UTFT", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/VirtualWire", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/WS2812Serial", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XBee", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XPT2046_Touchscreen", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/i2c_t3", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ks0108", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ssd1351", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/x10", - "" - ], - "browse": { - "limitSymbolsToIncludedHeaders": true, - "path": [ - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/include", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/src", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit LSM6DS", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/cores/teensy4", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit BusIO", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/Avionics/.pio/libdeps/teensy41/Adafruit Unified Sensor", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPI", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ADC", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AccelStepper/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_NeoPixel", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_STMPE610", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_VS1053", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AltSoftSerial", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Artnet", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce2/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CapacitiveSensor", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CryptoAccel/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DS1307RTC", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DmxSimple", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DogLcd", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EEPROM", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransfer/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransferI2C/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Entropy", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ethernet/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FNET/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastCRC", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastLED/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN_T4", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexIO_t4/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexiTimer2", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqCount", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasure", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasureMulti", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FrequencyTimer2", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9341_t3", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9488_t3/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/IRremote/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Keypad/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedControl/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedDisplay", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystal/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystalFast", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LittleFS/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LowPower", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MFRC522/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MIDI/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Metro", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MsTimer2", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NativeEthernet/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OSC", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OctoWS2811", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OneWire", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PWMServo", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ping", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PulsePosition", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/QuadEncoder", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RA8875/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RadioHead", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ResponsiveAnalogRead/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SD/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPIFlash", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ST7735_t3/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SdFat/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SerialFlash", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Servo", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ShiftPWM", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Snooze/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftPWM", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftwareSerial", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TFT_ILI9163C", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Talkie", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TeensyThreads", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Time", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimeAlarms", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerOne", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerThree", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TinyGPS", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Tlc5940", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TouchScreen", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/UTFT", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/VirtualWire", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/WS2812Serial", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XBee", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XPT2046_Touchscreen", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/i2c_t3", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ks0108", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ssd1351", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/x10", - "" - ] - }, - "defines": [ - "PLATFORMIO=60111", - "__IMXRT1062__", - "ARDUINO_TEENSY41", - "USB_SERIAL", - "ARDUINO=10805", - "TEENSYDUINO=158", - "CORE_TEENSY", - "F_CPU=600000000", - "LAYOUT_US_ENGLISH", - "" - ], - "cppStandard": "gnu++14", - "compilerPath": "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc", - "compilerArgs": [ - "-mthumb", - "-mcpu=cortex-m7", - "-mfloat-abi=hard", - "-mfpu=fpv5-d16", - "" - ] - } - ], - "version": 4 -} diff --git a/platformio.ini b/platformio.ini deleted file mode 100644 index 9ee4b23..0000000 --- a/platformio.ini +++ /dev/null @@ -1,15 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html - -[env:teensy41] -platform = platformio/teensy@^4.18.0 -board = teensy41 -framework = arduino -lib_deps = adafruit/Adafruit LSM6DS@^4.7.0 From 8b4efa66b2936211a02ccca88034c307f964320b Mon Sep 17 00:00:00 2001 From: Vincent Palmerio Date: Wed, 1 Nov 2023 23:39:23 -0400 Subject: [PATCH 22/49] Added include guards to LSM6DS_LIS3MDL header --- ASTRA/IMU/include/LSM6DS_LIS3MDL.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ASTRA/IMU/include/LSM6DS_LIS3MDL.h b/ASTRA/IMU/include/LSM6DS_LIS3MDL.h index 10baa7c..c495f02 100644 --- a/ASTRA/IMU/include/LSM6DS_LIS3MDL.h +++ b/ASTRA/IMU/include/LSM6DS_LIS3MDL.h @@ -1,3 +1,7 @@ + +#ifndef LSM6DS_LIS3MDL +#define LSM6DS_LIS3MDL + #include Adafruit_LIS3MDL lis3mdl; @@ -33,4 +37,6 @@ void setup_sensors(void) { lis3mdl.setDataRate(LIS3MDL_DATARATE_1000_HZ); lis3mdl.setPerformanceMode(LIS3MDL_MEDIUMMODE); lis3mdl.setOperationMode(LIS3MDL_CONTINUOUSMODE); -} \ No newline at end of file +} + +#endif \ No newline at end of file From 6d75169fe5902ff14b215f26faea3f19a97885bd Mon Sep 17 00:00:00 2001 From: Vincent Palmerio Date: Sat, 4 Nov 2023 00:12:34 -0400 Subject: [PATCH 23/49] Created loadCalibration() to load predetermined calibration values, moved Serial.println's under preprocessor if statements --- ASTRA/IMU/src/IMU.cpp | 91 +++++++++++++++++++++++++++---------------- 1 file changed, 57 insertions(+), 34 deletions(-) diff --git a/ASTRA/IMU/src/IMU.cpp b/ASTRA/IMU/src/IMU.cpp index f9c5d2b..bbfa4a2 100644 --- a/ASTRA/IMU/src/IMU.cpp +++ b/ASTRA/IMU/src/IMU.cpp @@ -3,27 +3,63 @@ #include "../include/LSM6DS_LIS3MDL.h" - float roll, pitch, heading = 0; float gx, gy, gz = 0; //degrees per second on gyro float qw, qx, qy, qz = 0; //quaternarion +int loadCalibration() { + cal.mag_hardiron[0] = 0.0; + cal.mag_hardiron[1] = 0.0; + cal.mag_hardiron[2] = 0.0; + + // in uTesla + cal.mag_softiron[0] = 1.0; + cal.mag_softiron[1] = 0.0; + cal.mag_softiron[2] = 0.0; + cal.mag_softiron[3] = 0.0; + cal.mag_softiron[4] = 1.0; + cal.mag_softiron[5] = 0.0; + cal.mag_softiron[6] = 0.0; + cal.mag_softiron[7] = 0.0; + cal.mag_softiron[8] = 1.0; + + // in Radians/s + cal.gyro_zerorate[0] = 0.0; + cal.gyro_zerorate[1] = 0.0; + cal.gyro_zerorate[2] = 0.0; + + cal.saveCalibration(); +} + + int setupIMU() { Serial.begin(115200); while (!Serial) yield(); if (!cal.begin()) { //Failed to initialize calibration helper +#if defined(ASTRA_FULL_DEBUG) or defined(ASTRA_IMU_DEBUG) Serial.print("Failed to initialize calibration helper"); +#endif return FAILED_CALIBRATION_HELPER_INIT; - } else if (!cal.loadCalibration()) { + } + + //Load calibration settings to teensy EEPROM + loadCalibration(); + + if (!cal.loadCalibration()) { //No calibration loaded/found - Serial.println("No calibration loaded/found"); - return NO_CALIBRATION_FOUND; +#if defined(ASTRA_FULL_DEBUG) or defined(ASTRA_IMU_DEBUG) + Serial.println("Failed to load calibration"); +#endif + return FAILED_LOAD_CALIBRATION; } if (!init_sensors()) { //Failed to find sensors +#if defined(ASTRA_FULL_DEBUG) or defined(ASTRA_IMU_DEBUG) + Serial.println("Failed to find sensors"); +#endif return FAILED_SENSOR_INIT; } @@ -43,25 +79,15 @@ int setupIMU() { } int updateIMU() { - // float roll, pitch, heading; - // float gx, gy, gz; - - static uint8_t counter = 0; - - // if ((millis() - timestamp) < (1000 / FILTER_UPDATE_RATE_HZ)) { - // return; - // } + timestamp = millis(); + // Read the motion sensors sensors_event_t accel, gyro, mag; accelerometer->getEvent(&accel); gyroscope->getEvent(&gyro); magnetometer->getEvent(&mag); -#if defined(AHRS_DEBUG_OUTPUT) - Serial.print("I2C took "); Serial.print(millis()-timestamp); Serial.println(" ms"); -#endif - cal.calibrate(mag); cal.calibrate(accel); cal.calibrate(gyro); @@ -76,18 +102,23 @@ int updateIMU() { filter.update(gx, gy, gz, accel.acceleration.x, accel.acceleration.y, accel.acceleration.z, mag.magnetic.x, mag.magnetic.y, mag.magnetic.z); -#if defined(AHRS_DEBUG_OUTPUT) - Serial.print("Update took "); Serial.print(millis()-timestamp); Serial.println(" ms"); -#endif - // only print the calculated output once in a while - // if (counter++ <= PRINT_EVERY_N_UPDATES) { - // return; - // } - // reset the counter - //counter = 0; + // print the heading, pitch and roll + roll = filter.getRoll(); + pitch = filter.getPitch(); + heading = filter.getYaw(); + + + //float qw, qx, qy, qz; + filter.getQuaternion(&qw, &qx, &qy, &qz); + #if defined(ASTRA_FULL_DEBUG) or defined(ASTRA_IMU_DEBUG) + + Serial.print("I2C took "); Serial.print(millis()-timestamp); Serial.println(" ms"); + + Serial.print("Update took "); Serial.print(millis()-timestamp); Serial.println(" ms"); + Serial.print("Raw: "); Serial.print(accel.acceleration.x, 4); Serial.print(", "); Serial.print(accel.acceleration.y, 4); Serial.print(", "); @@ -98,12 +129,7 @@ int updateIMU() { Serial.print(mag.magnetic.x, 4); Serial.print(", "); Serial.print(mag.magnetic.y, 4); Serial.print(", "); Serial.print(mag.magnetic.z, 4); Serial.println(""); -#endif - // print the heading, pitch and roll - roll = filter.getRoll(); - pitch = filter.getPitch(); - heading = filter.getYaw(); Serial.print("Orientation: "); Serial.print(heading); Serial.print(", "); @@ -111,8 +137,6 @@ int updateIMU() { Serial.print(", "); Serial.println(roll); - //float qw, qx, qy, qz; - filter.getQuaternion(&qw, &qx, &qy, &qz); Serial.print("Quaternion: "); Serial.print(qw, 4); Serial.print(", "); @@ -121,11 +145,10 @@ int updateIMU() { Serial.print(qy, 4); Serial.print(", "); Serial.println(qz, 4); - -#if defined(AHRS_DEBUG_OUTPUT) Serial.print("Took "); Serial.print(millis()-timestamp); Serial.println(" ms"); #endif + return NO_ERROR_CODE; } From b937cdc9aab8edc11db0b738775ba15af161358a Mon Sep 17 00:00:00 2001 From: Vincent Palmerio Date: Sat, 4 Nov 2023 00:25:04 -0400 Subject: [PATCH 24/49] Changed NO_CALIBRATION_FOUND error to FAILED_LOAD_CALIBRATION --- ASTRA/error/DriverError.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ASTRA/error/DriverError.h b/ASTRA/error/DriverError.h index f974dfa..f4e0a2b 100644 --- a/ASTRA/error/DriverError.h +++ b/ASTRA/error/DriverError.h @@ -15,7 +15,7 @@ Last updated: 10/2/2023 //IMU Error codes are in the 100's #define FAILED_CALIBRATION_HELPER_INIT -100 -#define NO_CALIBRATION_FOUND -101 +#define FAILED_LOAD_CALIBRATION -101 #define FAILED_SENSOR_INIT -102 From 0938b3babe2640eb47bd877b76f6edcd2dcdf051 Mon Sep 17 00:00:00 2001 From: Vincent Palmerio Date: Sat, 4 Nov 2023 00:31:38 -0400 Subject: [PATCH 25/49] Changed sensor to correct type and added docstring --- ASTRA/IMU/include/LSM6DS_LIS3MDL.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ASTRA/IMU/include/LSM6DS_LIS3MDL.h b/ASTRA/IMU/include/LSM6DS_LIS3MDL.h index c495f02..7f7d1be 100644 --- a/ASTRA/IMU/include/LSM6DS_LIS3MDL.h +++ b/ASTRA/IMU/include/LSM6DS_LIS3MDL.h @@ -1,13 +1,19 @@ +/* +LSM6DS_LIS3MDL.h +Description: Header file for sensor-setup function definitions +Author: Vincent Palmerio +Last updated: 11/4/2023 +*/ + #ifndef LSM6DS_LIS3MDL #define LSM6DS_LIS3MDL #include Adafruit_LIS3MDL lis3mdl; -// Can change this to be LSM6DSOX or whatever ya like -#include -Adafruit_LSM6DS33 lsm6ds; +#include +Adafruit_LSM6DSOX lsm6ds; Adafruit_Sensor* accelerometer; Adafruit_Sensor* gyroscope; From 66ef462dcb1a180bcad9af2bb5f836bdd8367405 Mon Sep 17 00:00:00 2001 From: Vincent Palmerio Date: Sat, 4 Nov 2023 00:32:55 -0400 Subject: [PATCH 26/49] Added link to LSM6DS_LIS3MDL.h original source --- ASTRA/IMU/include/LSM6DS_LIS3MDL.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ASTRA/IMU/include/LSM6DS_LIS3MDL.h b/ASTRA/IMU/include/LSM6DS_LIS3MDL.h index 7f7d1be..d9bb782 100644 --- a/ASTRA/IMU/include/LSM6DS_LIS3MDL.h +++ b/ASTRA/IMU/include/LSM6DS_LIS3MDL.h @@ -2,7 +2,7 @@ /* LSM6DS_LIS3MDL.h Description: Header file for sensor-setup function definitions -Author: Vincent Palmerio +Author: Vincent Palmerio, (Original: https://github.com/adafruit/Adafruit_AHRS/blob/master/examples/calibrated_orientation/calibrated_orientation.ino) Last updated: 11/4/2023 */ From 55c6a0e4947fbdb08c0fb694ef0d8b7dc0476860 Mon Sep 17 00:00:00 2001 From: Vincent Palmerio Date: Sat, 4 Nov 2023 00:33:36 -0400 Subject: [PATCH 27/49] Added docstring to IMU.cpp and IMU.h --- ASTRA/IMU/src/IMU.cpp | 6 ++++++ ASTRA/IMU/src/IMU.h | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/ASTRA/IMU/src/IMU.cpp b/ASTRA/IMU/src/IMU.cpp index bbfa4a2..a5787b3 100644 --- a/ASTRA/IMU/src/IMU.cpp +++ b/ASTRA/IMU/src/IMU.cpp @@ -2,6 +2,12 @@ #include "../../error/DriverError.h" #include "../include/LSM6DS_LIS3MDL.h" +/* +IMU.cpp +Description: Function definititions for declarations in IMU.h +Author: Vincent Palmerio +Last updated: 11/4/2023 +*/ float roll, pitch, heading = 0; float gx, gy, gz = 0; //degrees per second on gyro diff --git a/ASTRA/IMU/src/IMU.h b/ASTRA/IMU/src/IMU.h index e6b4cfc..5202c87 100644 --- a/ASTRA/IMU/src/IMU.h +++ b/ASTRA/IMU/src/IMU.h @@ -1,4 +1,11 @@ +/* +IMU.h - Header file for the IMU Driver +Description: Contains all functions and variables to interact with the IMU +Author: Vincent Palmerio +Last updated: 11/4/2023 +*/ + #ifndef IMU_H #define IMU_H @@ -15,6 +22,8 @@ #define PRINT_EVERY_N_UPDATES 10 + + // Full orientation sensing using NXP/Madgwick/Mahony and a range of 9-DoF // sensor sets. // You *must* perform a magnetic calibration before this code will work. From da00026c37b8da8ea14af44944c7ab3e628148f6 Mon Sep 17 00:00:00 2001 From: Vincent Palmerio Date: Sat, 4 Nov 2023 11:37:16 -0400 Subject: [PATCH 28/49] Removed unused variables in IMU.h --- ASTRA/IMU/src/IMU.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/ASTRA/IMU/src/IMU.h b/ASTRA/IMU/src/IMU.h index 5202c87..d9f3dae 100644 --- a/ASTRA/IMU/src/IMU.h +++ b/ASTRA/IMU/src/IMU.h @@ -18,9 +18,6 @@ Last updated: 11/4/2023 //uncomment to print data to console for just IMU //#define ASTRA_IMU_DEBUG -#define FILTER_UPDATE_RATE_HZ 100 -#define PRINT_EVERY_N_UPDATES 10 - From 42414faab087197da4026fa0f71621a0458e3ad6 Mon Sep 17 00:00:00 2001 From: Vincent Palmerio Date: Sat, 4 Nov 2023 14:00:36 -0400 Subject: [PATCH 29/49] Changed setupIMU to initalizeIMU to match naming scheme --- ASTRA/IMU/src/IMU.cpp | 2 +- ASTRA/IMU/src/IMU.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ASTRA/IMU/src/IMU.cpp b/ASTRA/IMU/src/IMU.cpp index a5787b3..ab3547b 100644 --- a/ASTRA/IMU/src/IMU.cpp +++ b/ASTRA/IMU/src/IMU.cpp @@ -38,7 +38,7 @@ int loadCalibration() { } -int setupIMU() { +int initalizeIMU() { Serial.begin(115200); while (!Serial) yield(); diff --git a/ASTRA/IMU/src/IMU.h b/ASTRA/IMU/src/IMU.h index d9f3dae..dbb4d55 100644 --- a/ASTRA/IMU/src/IMU.h +++ b/ASTRA/IMU/src/IMU.h @@ -51,7 +51,7 @@ static uint32_t timestamp; // slower == better quality output static Adafruit_NXPSensorFusion filter; // slowest -extern int setupIMU(); +extern int initalizeIMU(); extern int updateIMU(); #endif From 5b00e1f42670d1f227adae3e6b11a5bd1c2f7b13 Mon Sep 17 00:00:00 2001 From: Vincent Palmerio Date: Sat, 4 Nov 2023 14:50:35 -0400 Subject: [PATCH 30/49] Fixed test to use initalizeIMU() --- ASTRA/IMU/src/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ASTRA/IMU/src/main.cpp b/ASTRA/IMU/src/main.cpp index f1aa191..747ee39 100644 --- a/ASTRA/IMU/src/main.cpp +++ b/ASTRA/IMU/src/main.cpp @@ -1,12 +1,11 @@ #include "IMU.h" void setup() { - setupIMU(); + initalizeIMU(); } void loop() { updateIMU(); Serial.print("test"); Serial.print(heading); - } \ No newline at end of file From 73a3ee5ef05e3c74bb2ad6832de7044d9aaff94a Mon Sep 17 00:00:00 2001 From: Vincent Palmerio Date: Mon, 6 Nov 2023 19:02:42 -0500 Subject: [PATCH 31/49] calibration is no longer loaded into EEPROM every startup --- ASTRA/IMU/src/IMU.cpp | 5 +---- ASTRA/IMU/src/IMU.h | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ASTRA/IMU/src/IMU.cpp b/ASTRA/IMU/src/IMU.cpp index ab3547b..10db1c2 100644 --- a/ASTRA/IMU/src/IMU.cpp +++ b/ASTRA/IMU/src/IMU.cpp @@ -13,7 +13,7 @@ float roll, pitch, heading = 0; float gx, gy, gz = 0; //degrees per second on gyro float qw, qx, qy, qz = 0; //quaternarion -int loadCalibration() { +int loadPresetCalibration() { cal.mag_hardiron[0] = 0.0; cal.mag_hardiron[1] = 0.0; cal.mag_hardiron[2] = 0.0; @@ -49,9 +49,6 @@ int initalizeIMU() { #endif return FAILED_CALIBRATION_HELPER_INIT; } - - //Load calibration settings to teensy EEPROM - loadCalibration(); if (!cal.loadCalibration()) { //No calibration loaded/found diff --git a/ASTRA/IMU/src/IMU.h b/ASTRA/IMU/src/IMU.h index dbb4d55..1830597 100644 --- a/ASTRA/IMU/src/IMU.h +++ b/ASTRA/IMU/src/IMU.h @@ -53,6 +53,7 @@ static Adafruit_NXPSensorFusion filter; // slowest extern int initalizeIMU(); extern int updateIMU(); +extern int loadPresetCalibration(); #endif From 9ef82efb698ee257bd9d446a5cb2f8d3944ab367 Mon Sep 17 00:00:00 2001 From: Vincent Palmerio Date: Mon, 6 Nov 2023 19:02:56 -0500 Subject: [PATCH 32/49] Removed unused files --- include/README | 39 --------------------------------------- lib/README | 46 ---------------------------------------------- 2 files changed, 85 deletions(-) delete mode 100644 include/README delete mode 100644 lib/README diff --git a/include/README b/include/README deleted file mode 100644 index 194dcd4..0000000 --- a/include/README +++ /dev/null @@ -1,39 +0,0 @@ - -This directory is intended for project header files. - -A header file is a file containing C declarations and macro definitions -to be shared between several project source files. You request the use of a -header file in your project source file (C, C++, etc) located in `src` folder -by including it, with the C preprocessing directive `#include'. - -```src/main.c - -#include "header.h" - -int main (void) -{ - ... -} -``` - -Including a header file produces the same results as copying the header file -into each source file that needs it. Such copying would be time-consuming -and error-prone. With a header file, the related declarations appear -in only one place. If they need to be changed, they can be changed in one -place, and programs that include the header file will automatically use the -new version when next recompiled. The header file eliminates the labor of -finding and changing all the copies as well as the risk that a failure to -find one copy will result in inconsistencies within a program. - -In C, the usual convention is to give header files names that end with `.h'. -It is most portable to use only letters, digits, dashes, and underscores in -header file names, and at most one dot. - -Read more about using header files in official GCC documentation: - -* Include Syntax -* Include Operation -* Once-Only Headers -* Computed Includes - -https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/lib/README b/lib/README deleted file mode 100644 index 6debab1..0000000 --- a/lib/README +++ /dev/null @@ -1,46 +0,0 @@ - -This directory is intended for project specific (private) libraries. -PlatformIO will compile them to static libraries and link into executable file. - -The source code of each library should be placed in a an own separate directory -("lib/your_library_name/[here are source files]"). - -For example, see a structure of the following two libraries `Foo` and `Bar`: - -|--lib -| | -| |--Bar -| | |--docs -| | |--examples -| | |--src -| | |- Bar.c -| | |- Bar.h -| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html -| | -| |--Foo -| | |- Foo.c -| | |- Foo.h -| | -| |- README --> THIS FILE -| -|- platformio.ini -|--src - |- main.c - -and a contents of `src/main.c`: -``` -#include -#include - -int main (void) -{ - ... -} - -``` - -PlatformIO Library Dependency Finder will find automatically dependent -libraries scanning project source files. - -More information about PlatformIO Library Dependency Finder -- https://docs.platformio.org/page/librarymanager/ldf.html From 1da70995eec552edba8ed6b6f442a6726f54794a Mon Sep 17 00:00:00 2001 From: vpalmerio Date: Sat, 11 Nov 2023 11:45:38 -0500 Subject: [PATCH 33/49] Restructured IMU library for proper organization --- .DS_Store | Bin 6148 -> 6148 bytes ASTRA/testing/IMU_Debug/.gitignore | 1 + .../IMU_Debug/.vscode/c_cpp_properties.json | 289 ++++++++++++++++++ .../testing/IMU_Debug/.vscode/extensions.json | 10 + ASTRA/testing/IMU_Debug/.vscode/launch.json | 44 +++ ASTRA/testing/IMU_Debug/include/README | 39 +++ ASTRA/testing/IMU_Debug/lib/README | 46 +++ .../{IMU => testing/IMU_Debug}/platformio.ini | 9 +- ASTRA/{IMU => testing/IMU_Debug}/src/main.cpp | 2 +- ASTRA/testing/IMU_Debug/test/README | 11 + 10 files changed, 446 insertions(+), 5 deletions(-) create mode 100644 ASTRA/testing/IMU_Debug/.gitignore create mode 100644 ASTRA/testing/IMU_Debug/.vscode/c_cpp_properties.json create mode 100644 ASTRA/testing/IMU_Debug/.vscode/extensions.json create mode 100644 ASTRA/testing/IMU_Debug/.vscode/launch.json create mode 100644 ASTRA/testing/IMU_Debug/include/README create mode 100644 ASTRA/testing/IMU_Debug/lib/README rename ASTRA/{IMU => testing/IMU_Debug}/platformio.ini (83%) rename ASTRA/{IMU => testing/IMU_Debug}/src/main.cpp (78%) create mode 100644 ASTRA/testing/IMU_Debug/test/README diff --git a/.DS_Store b/.DS_Store index 1d2af23a88347837e486901b28345317a899260f..64edd318cde3bc3c3db50eef2dc95bc03be2c25e 100644 GIT binary patch delta 75 zcmZoMXfc=|#>B)qu~2NHo+2aL#(>?7jBJ~ESnL@mH?tW{-p}r_S%HI{WnzQ%W_AvK d4xrM_f*jwOC-aLqaxee^BLf4=<_M8B%mCO;5rF^z delta 257 zcmZoMXfc=|#>B!ku~2NHo+2af#(>?7i#IScG4gKaVX|k8W@pG`$YV%m$YCgDNMT6z z%*jtq%E?b+U|>T_YKo4$S$o!poGQWr; R2O|Rm6VM!n%@HDNm;o(3L@odT diff --git a/ASTRA/testing/IMU_Debug/.gitignore b/ASTRA/testing/IMU_Debug/.gitignore new file mode 100644 index 0000000..03f4a3c --- /dev/null +++ b/ASTRA/testing/IMU_Debug/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/ASTRA/testing/IMU_Debug/.vscode/c_cpp_properties.json b/ASTRA/testing/IMU_Debug/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..ac965d1 --- /dev/null +++ b/ASTRA/testing/IMU_Debug/.vscode/c_cpp_properties.json @@ -0,0 +1,289 @@ +// +// !!! WARNING !!! AUTO-GENERATED FILE! +// PLEASE DO NOT MODIFY IT AND USE "platformio.ini": +// https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags +// +{ + "configurations": [ + { + "name": "PlatformIO", + "includePath": [ + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/include", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/src", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/IMU/src", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/IMU/include", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit Sensor Calibration", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EEPROM", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit AHRS/src", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LIS3MDL", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM6DS", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit Unified Sensor", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit BusIO", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPI", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/cores/teensy4", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/IMU/.vscode", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit BMP085 Unified", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit BluefruitLE nRF51", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit BluefruitLE nRF51/utility", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit FXAS21002C", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit FXOS8700", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM303 Accel", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM303DLH Mag", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM9DS0 Library", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM9DS1 Library", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit SPIFlash/src", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/ArduinoJson/src", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/SdFat - Adafruit Fork/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ADC", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AccelStepper/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_NeoPixel", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_STMPE610", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_VS1053", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AltSoftSerial", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Artnet", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce2/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CapacitiveSensor", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CryptoAccel/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DS1307RTC", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DmxSimple", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DogLcd", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransfer/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransferI2C/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Entropy", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ethernet/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FNET/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastCRC", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastLED/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN_T4", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexIO_t4/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexiTimer2", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqCount", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasure", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasureMulti", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FrequencyTimer2", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9341_t3", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9488_t3/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/IRremote/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Keypad/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedControl/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedDisplay", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystal/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystalFast", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LittleFS/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LowPower", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MFRC522/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MIDI/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Metro", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MsTimer2", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NativeEthernet/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OSC", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OctoWS2811", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OneWire", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PWMServo", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ping", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PulsePosition", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/QuadEncoder", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RA8875/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RadioHead", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ResponsiveAnalogRead/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SD/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPIFlash", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ST7735_t3/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SdFat/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SerialFlash", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Servo", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ShiftPWM", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Snooze/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftPWM", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftwareSerial", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TFT_ILI9163C", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Talkie", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TeensyThreads", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Time", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimeAlarms", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerOne", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerThree", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TinyGPS", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Tlc5940", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TouchScreen", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/UTFT", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/VirtualWire", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/WS2812Serial", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XBee", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XPT2046_Touchscreen", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/i2c_t3", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ks0108", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ssd1351", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/x10", + "" + ], + "browse": { + "limitSymbolsToIncludedHeaders": true, + "path": [ + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/include", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/src", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/IMU/src", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/IMU/include", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit Sensor Calibration", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EEPROM", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit AHRS/src", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LIS3MDL", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM6DS", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit Unified Sensor", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit BusIO", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPI", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/cores/teensy4", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/IMU/.vscode", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit BMP085 Unified", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit BluefruitLE nRF51", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit BluefruitLE nRF51/utility", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit FXAS21002C", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit FXOS8700", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM303 Accel", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM303DLH Mag", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM9DS0 Library", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM9DS1 Library", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit SPIFlash/src", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/ArduinoJson/src", + "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/SdFat - Adafruit Fork/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ADC", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AccelStepper/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_NeoPixel", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_STMPE610", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_VS1053", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AltSoftSerial", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Artnet", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce2/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CapacitiveSensor", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CryptoAccel/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DS1307RTC", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DmxSimple", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DogLcd", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransfer/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransferI2C/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Entropy", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ethernet/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FNET/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastCRC", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastLED/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN_T4", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexIO_t4/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexiTimer2", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqCount", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasure", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasureMulti", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FrequencyTimer2", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9341_t3", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9488_t3/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/IRremote/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Keypad/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedControl/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedDisplay", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystal/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystalFast", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LittleFS/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LowPower", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MFRC522/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MIDI/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Metro", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MsTimer2", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NativeEthernet/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OSC", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OctoWS2811", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OneWire", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PWMServo", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ping", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PulsePosition", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/QuadEncoder", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RA8875/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RadioHead", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ResponsiveAnalogRead/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SD/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPIFlash", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ST7735_t3/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SdFat/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SerialFlash", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Servo", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ShiftPWM", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Snooze/src", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftPWM", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftwareSerial", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TFT_ILI9163C", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Talkie", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TeensyThreads", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Time", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimeAlarms", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerOne", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerThree", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TinyGPS", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Tlc5940", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TouchScreen", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36/utility", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/UTFT", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/VirtualWire", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/WS2812Serial", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XBee", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XPT2046_Touchscreen", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/i2c_t3", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ks0108", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ssd1351", + "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/x10", + "" + ] + }, + "defines": [ + "PLATFORMIO=60111", + "__IMXRT1062__", + "ARDUINO_TEENSY41", + "USB_SERIAL", + "ARDUINO=10805", + "TEENSYDUINO=158", + "CORE_TEENSY", + "F_CPU=600000000", + "LAYOUT_US_ENGLISH", + "" + ], + "cppStandard": "gnu++14", + "compilerPath": "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc", + "compilerArgs": [ + "-mthumb", + "-mcpu=cortex-m7", + "-mfloat-abi=hard", + "-mfpu=fpv5-d16", + "" + ] + } + ], + "version": 4 +} diff --git a/ASTRA/testing/IMU_Debug/.vscode/extensions.json b/ASTRA/testing/IMU_Debug/.vscode/extensions.json new file mode 100644 index 0000000..080e70d --- /dev/null +++ b/ASTRA/testing/IMU_Debug/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "platformio.platformio-ide" + ], + "unwantedRecommendations": [ + "ms-vscode.cpptools-extension-pack" + ] +} diff --git a/ASTRA/testing/IMU_Debug/.vscode/launch.json b/ASTRA/testing/IMU_Debug/.vscode/launch.json new file mode 100644 index 0000000..fd1d0d8 --- /dev/null +++ b/ASTRA/testing/IMU_Debug/.vscode/launch.json @@ -0,0 +1,44 @@ +// AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY +// +// PIO Unified Debugger +// +// Documentation: https://docs.platformio.org/page/plus/debugging.html +// Configuration: https://docs.platformio.org/page/projectconf/section_env_debug.html + +{ + "version": "0.2.0", + "configurations": [ + { + "type": "platformio-debug", + "request": "launch", + "name": "PIO Debug", + "executable": "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/build/teensy41/firmware.elf", + "projectEnvName": "teensy41", + "toolchainBinDir": "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin", + "internalConsoleOptions": "openOnSessionStart", + "preLaunchTask": { + "type": "PlatformIO", + "task": "Pre-Debug" + } + }, + { + "type": "platformio-debug", + "request": "launch", + "name": "PIO Debug (skip Pre-Debug)", + "executable": "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/build/teensy41/firmware.elf", + "projectEnvName": "teensy41", + "toolchainBinDir": "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin", + "internalConsoleOptions": "openOnSessionStart" + }, + { + "type": "platformio-debug", + "request": "launch", + "name": "PIO Debug (without uploading)", + "executable": "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/build/teensy41/firmware.elf", + "projectEnvName": "teensy41", + "toolchainBinDir": "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin", + "internalConsoleOptions": "openOnSessionStart", + "loadMode": "manual" + } + ] +} diff --git a/ASTRA/testing/IMU_Debug/include/README b/ASTRA/testing/IMU_Debug/include/README new file mode 100644 index 0000000..194dcd4 --- /dev/null +++ b/ASTRA/testing/IMU_Debug/include/README @@ -0,0 +1,39 @@ + +This directory is intended for project header files. + +A header file is a file containing C declarations and macro definitions +to be shared between several project source files. You request the use of a +header file in your project source file (C, C++, etc) located in `src` folder +by including it, with the C preprocessing directive `#include'. + +```src/main.c + +#include "header.h" + +int main (void) +{ + ... +} +``` + +Including a header file produces the same results as copying the header file +into each source file that needs it. Such copying would be time-consuming +and error-prone. With a header file, the related declarations appear +in only one place. If they need to be changed, they can be changed in one +place, and programs that include the header file will automatically use the +new version when next recompiled. The header file eliminates the labor of +finding and changing all the copies as well as the risk that a failure to +find one copy will result in inconsistencies within a program. + +In C, the usual convention is to give header files names that end with `.h'. +It is most portable to use only letters, digits, dashes, and underscores in +header file names, and at most one dot. + +Read more about using header files in official GCC documentation: + +* Include Syntax +* Include Operation +* Once-Only Headers +* Computed Includes + +https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html diff --git a/ASTRA/testing/IMU_Debug/lib/README b/ASTRA/testing/IMU_Debug/lib/README new file mode 100644 index 0000000..6debab1 --- /dev/null +++ b/ASTRA/testing/IMU_Debug/lib/README @@ -0,0 +1,46 @@ + +This directory is intended for project specific (private) libraries. +PlatformIO will compile them to static libraries and link into executable file. + +The source code of each library should be placed in a an own separate directory +("lib/your_library_name/[here are source files]"). + +For example, see a structure of the following two libraries `Foo` and `Bar`: + +|--lib +| | +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html +| | +| |--Foo +| | |- Foo.c +| | |- Foo.h +| | +| |- README --> THIS FILE +| +|- platformio.ini +|--src + |- main.c + +and a contents of `src/main.c`: +``` +#include +#include + +int main (void) +{ + ... +} + +``` + +PlatformIO Library Dependency Finder will find automatically dependent +libraries scanning project source files. + +More information about PlatformIO Library Dependency Finder +- https://docs.platformio.org/page/librarymanager/ldf.html diff --git a/ASTRA/IMU/platformio.ini b/ASTRA/testing/IMU_Debug/platformio.ini similarity index 83% rename from ASTRA/IMU/platformio.ini rename to ASTRA/testing/IMU_Debug/platformio.ini index 165acbb..38b79c6 100644 --- a/ASTRA/IMU/platformio.ini +++ b/ASTRA/testing/IMU_Debug/platformio.ini @@ -12,13 +12,14 @@ platform = platformio/teensy@^4.18.0 board = teensy41 framework = arduino -lib_deps = - adafruit/Adafruit LSM6DS@^4.7.0 - adafruit/Adafruit LIS3MDL@^1.2.1 +lib_extra_dirs = ../../IMU +lib_deps = + adafruit/Adafruit LSM6DS@^4.7.0 + adafruit/Adafruit LIS3MDL@^1.2.1 adafruit/Adafruit AHRS@^2.3.3 adafruit/Adafruit Unified Sensor@^1.1.13 adafruit/Adafruit BusIO@^1.14.5 Wire SPI adafruit/Adafruit Sensor Calibration@^1.1.5 - EEPROM + EEPROM \ No newline at end of file diff --git a/ASTRA/IMU/src/main.cpp b/ASTRA/testing/IMU_Debug/src/main.cpp similarity index 78% rename from ASTRA/IMU/src/main.cpp rename to ASTRA/testing/IMU_Debug/src/main.cpp index 747ee39..30d457f 100644 --- a/ASTRA/IMU/src/main.cpp +++ b/ASTRA/testing/IMU_Debug/src/main.cpp @@ -1,4 +1,4 @@ -#include "IMU.h" +#include "../../../IMU/src/IMU.h" void setup() { initalizeIMU(); diff --git a/ASTRA/testing/IMU_Debug/test/README b/ASTRA/testing/IMU_Debug/test/README new file mode 100644 index 0000000..9b1e87b --- /dev/null +++ b/ASTRA/testing/IMU_Debug/test/README @@ -0,0 +1,11 @@ + +This directory is intended for PlatformIO Test Runner and project tests. + +Unit Testing is a software testing method by which individual units of +source code, sets of one or more MCU program modules together with associated +control data, usage procedures, and operating procedures, are tested to +determine whether they are fit for use. Unit testing finds problems early +in the development cycle. + +More information about PlatformIO Unit Testing: +- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html From e8cb60f1b284373a29d92eadce64debe8ad72f04 Mon Sep 17 00:00:00 2001 From: vpalmerio Date: Sat, 11 Nov 2023 12:39:59 -0500 Subject: [PATCH 34/49] Updated .DS_Store --- ASTRA/IMU/.DS_Store | Bin 6148 -> 6148 bytes ASTRA/IMU/src/.DS_Store | Bin 6148 -> 6148 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/ASTRA/IMU/.DS_Store b/ASTRA/IMU/.DS_Store index 832e6665c11e28f892672d18d9c2a2966b10868d..3b556d270ef610d96f78fe37b6069ee31d50aa15 100644 GIT binary patch delta 71 zcmZoMXfc=|#>B)qu~2NHo+2aL#(>?7jBJy6Sj;D9v&3!IX1&9-v7w7;Gdl-A2T<8& ZL5}atlles)IT(O|k%56_bA-qmW&og05fuOc delta 183 zcmZoMXfc=|#>B!ku~2NHo+2aX#(>?7iw`g}F>+4kVKSFwVbEhJV8~?1_sq#pPRhwo zVqjnpU|?YUIoX6MH#7$*lY}b6upX#F?>`s-Squz(K>axki3}wSX$<)cMGUzh(}1RC xGUPF2qUvRo1?k;9h3O^JW_AvK4xqC(Z)EZ<_M8B%mBDjEJFYQ diff --git a/ASTRA/IMU/src/.DS_Store b/ASTRA/IMU/src/.DS_Store index 7bdc9ab0efc3034cf4c71c366c6fc20f33ec0e10..2a1ceb5a7ce9d474acb6139e161f27e74e920193 100644 GIT binary patch delta 140 zcmZoMXfc=|#>CJ*u~2NHo}wrd0|Nsi1A_nqLo!1FLxE>besWUI#6tDS1|lr{>`u9R%Cw0ve|&yo@p~X2R{eUI-tmR V=E?jbhKvl8ZFrB)qu~2NHo}w@_0|Nsi1A_oVesWSyeiD!;u<_$cMsAQeGea>$5kvCC zdGhs8W>R@^0aV$Jq=KBx;t~UcYm7|HEUawo9PAw29I?R}`Q^bSi6y1QPKia)AYMp* zeohjMotPAsnOYt%AmW^#SCW{Sms$kYkeQMSR1y=OnU|7Z?v!7emr@MY8w`=)NaEz+ zj2Doot~N0+(NQopFsjv2sJ1jR&`~fkHmj}Wg1? Fm;u#?Q4Ih9 From 6540530f055ee3f8f71fc5f6fd2f0278ba2c0eb8 Mon Sep 17 00:00:00 2001 From: vpalmerio Date: Sat, 11 Nov 2023 12:51:56 -0500 Subject: [PATCH 35/49] Removed unnecessary files --- ASTRA/IMU/.gitignore | 5 ----- ASTRA/IMU/.vscode/extensions.json | 10 ---------- 2 files changed, 15 deletions(-) delete mode 100644 ASTRA/IMU/.gitignore delete mode 100644 ASTRA/IMU/.vscode/extensions.json diff --git a/ASTRA/IMU/.gitignore b/ASTRA/IMU/.gitignore deleted file mode 100644 index 89cc49c..0000000 --- a/ASTRA/IMU/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.pio -.vscode/.browse.c_cpp.db* -.vscode/c_cpp_properties.json -.vscode/launch.json -.vscode/ipch diff --git a/ASTRA/IMU/.vscode/extensions.json b/ASTRA/IMU/.vscode/extensions.json deleted file mode 100644 index 080e70d..0000000 --- a/ASTRA/IMU/.vscode/extensions.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - // See http://go.microsoft.com/fwlink/?LinkId=827846 - // for the documentation about the extensions.json format - "recommendations": [ - "platformio.platformio-ide" - ], - "unwantedRecommendations": [ - "ms-vscode.cpptools-extension-pack" - ] -} From 36c3a9809ae3005d857f99047b5a2be2100afccf Mon Sep 17 00:00:00 2001 From: vpalmerio Date: Sun, 12 Nov 2023 01:00:42 -0500 Subject: [PATCH 36/49] loadPresetCalibration() returns an error --- ASTRA/IMU/src/IMU.cpp | 7 +++---- ASTRA/IMU/src/IMU.h | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ASTRA/IMU/src/IMU.cpp b/ASTRA/IMU/src/IMU.cpp index 10db1c2..6575d6d 100644 --- a/ASTRA/IMU/src/IMU.cpp +++ b/ASTRA/IMU/src/IMU.cpp @@ -35,6 +35,8 @@ int loadPresetCalibration() { cal.gyro_zerorate[2] = 0.0; cal.saveCalibration(); + + return NO_ERROR_CODE; } @@ -74,8 +76,7 @@ int initalizeIMU() { setup_sensors(); filter.begin(FILTER_UPDATE_RATE_HZ); - timestamp = millis(); - + Wire.setClock(400000); // 400KHz return NO_ERROR_CODE; @@ -83,8 +84,6 @@ int initalizeIMU() { int updateIMU() { - timestamp = millis(); - // Read the motion sensors sensors_event_t accel, gyro, mag; accelerometer->getEvent(&accel); diff --git a/ASTRA/IMU/src/IMU.h b/ASTRA/IMU/src/IMU.h index 1830597..b9863f6 100644 --- a/ASTRA/IMU/src/IMU.h +++ b/ASTRA/IMU/src/IMU.h @@ -46,7 +46,6 @@ Last updated: 11/4/2023 extern float roll, pitch, heading; extern float gx, gy, gz; //degrees per second on gyro extern float qw, qx, qy, qz; //quaternarion -static uint32_t timestamp; // slower == better quality output static Adafruit_NXPSensorFusion filter; // slowest From 1daa6f9be4cd90357d47af5d04069a3c9028807f Mon Sep 17 00:00:00 2001 From: vpalmerio Date: Sun, 12 Nov 2023 01:02:12 -0500 Subject: [PATCH 37/49] Added .vscode to gitignore --- ASTRA/testing/IMU_Debug/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/ASTRA/testing/IMU_Debug/.gitignore b/ASTRA/testing/IMU_Debug/.gitignore index 03f4a3c..b9f3806 100644 --- a/ASTRA/testing/IMU_Debug/.gitignore +++ b/ASTRA/testing/IMU_Debug/.gitignore @@ -1 +1,2 @@ .pio +.vscode From 64d4f131f0066b8a5dd45ae6890d63a3dfa670ee Mon Sep 17 00:00:00 2001 From: vpalmerio Date: Sun, 12 Nov 2023 01:03:46 -0500 Subject: [PATCH 38/49] Removed .vscode from git --- .../IMU_Debug/.vscode/c_cpp_properties.json | 289 ------------------ .../testing/IMU_Debug/.vscode/extensions.json | 10 - ASTRA/testing/IMU_Debug/.vscode/launch.json | 44 --- 3 files changed, 343 deletions(-) delete mode 100644 ASTRA/testing/IMU_Debug/.vscode/c_cpp_properties.json delete mode 100644 ASTRA/testing/IMU_Debug/.vscode/extensions.json delete mode 100644 ASTRA/testing/IMU_Debug/.vscode/launch.json diff --git a/ASTRA/testing/IMU_Debug/.vscode/c_cpp_properties.json b/ASTRA/testing/IMU_Debug/.vscode/c_cpp_properties.json deleted file mode 100644 index ac965d1..0000000 --- a/ASTRA/testing/IMU_Debug/.vscode/c_cpp_properties.json +++ /dev/null @@ -1,289 +0,0 @@ -// -// !!! WARNING !!! AUTO-GENERATED FILE! -// PLEASE DO NOT MODIFY IT AND USE "platformio.ini": -// https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags -// -{ - "configurations": [ - { - "name": "PlatformIO", - "includePath": [ - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/include", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/src", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/IMU/src", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/IMU/include", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit Sensor Calibration", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EEPROM", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit AHRS/src", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LIS3MDL", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM6DS", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit Unified Sensor", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit BusIO", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPI", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/cores/teensy4", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/IMU/.vscode", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit BMP085 Unified", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit BluefruitLE nRF51", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit BluefruitLE nRF51/utility", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit FXAS21002C", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit FXOS8700", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM303 Accel", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM303DLH Mag", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM9DS0 Library", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM9DS1 Library", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit SPIFlash/src", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/ArduinoJson/src", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/SdFat - Adafruit Fork/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ADC", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AccelStepper/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_NeoPixel", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_STMPE610", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_VS1053", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AltSoftSerial", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Artnet", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce2/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CapacitiveSensor", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CryptoAccel/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DS1307RTC", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DmxSimple", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DogLcd", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransfer/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransferI2C/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Entropy", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ethernet/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FNET/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastCRC", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastLED/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN_T4", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexIO_t4/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexiTimer2", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqCount", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasure", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasureMulti", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FrequencyTimer2", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9341_t3", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9488_t3/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/IRremote/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Keypad/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedControl/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedDisplay", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystal/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystalFast", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LittleFS/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LowPower", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MFRC522/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MIDI/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Metro", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MsTimer2", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NativeEthernet/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OSC", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OctoWS2811", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OneWire", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PWMServo", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ping", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PulsePosition", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/QuadEncoder", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RA8875/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RadioHead", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ResponsiveAnalogRead/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SD/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPIFlash", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ST7735_t3/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SdFat/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SerialFlash", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Servo", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ShiftPWM", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Snooze/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftPWM", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftwareSerial", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TFT_ILI9163C", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Talkie", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TeensyThreads", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Time", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimeAlarms", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerOne", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerThree", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TinyGPS", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Tlc5940", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TouchScreen", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/UTFT", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/VirtualWire", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/WS2812Serial", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XBee", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XPT2046_Touchscreen", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/i2c_t3", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ks0108", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ssd1351", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/x10", - "" - ], - "browse": { - "limitSymbolsToIncludedHeaders": true, - "path": [ - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/include", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/src", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/IMU/src", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/IMU/include", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit Sensor Calibration", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EEPROM", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit AHRS/src", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LIS3MDL", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM6DS", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit Unified Sensor", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit BusIO", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPI", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Wire/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/cores/teensy4", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/IMU/.vscode", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit BMP085 Unified", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit BluefruitLE nRF51", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit BluefruitLE nRF51/utility", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit FXAS21002C", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit FXOS8700", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM303 Accel", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM303DLH Mag", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM9DS0 Library", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit LSM9DS1 Library", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/Adafruit SPIFlash/src", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/ArduinoJson/src", - "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/libdeps/teensy41/SdFat - Adafruit Fork/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ADC", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AccelStepper/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_NeoPixel", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_STMPE610", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_VS1053", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Adafruit_nRF8001/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/AltSoftSerial", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Artnet", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Audio/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Bounce2/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CapacitiveSensor", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/CryptoAccel/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DS1307RTC", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DmxSimple", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/DogLcd", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransfer/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/EasyTransferI2C/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Encoder/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Entropy", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ethernet/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FNET/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastCRC", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FastLED/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexCAN_T4", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexIO_t4/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FlexiTimer2", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqCount", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasure", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FreqMeasureMulti", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/FrequencyTimer2", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9341_t3", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ILI9488_t3/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/IRremote/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Keypad/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedControl/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LedDisplay", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystal/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LiquidCrystalFast", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LittleFS/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/LowPower", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MFRC522/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MIDI/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Metro", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/MsTimer2", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NXPMotionSense/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/NativeEthernet/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OSC", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OctoWS2811", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/OneWire", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PS2Keyboard/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PWMServo", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Ping", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/PulsePosition", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/QuadEncoder", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RA8875/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/RadioHead", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ResponsiveAnalogRead/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SD/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SPIFlash", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ST7735_t3/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SdFat/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SerialFlash", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Servo", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ShiftPWM", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Snooze/src", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftPWM", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/SoftwareSerial", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TFT_ILI9163C", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Talkie", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TeensyThreads", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Time", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimeAlarms", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerOne", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TimerThree", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TinyGPS", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/Tlc5940", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/TouchScreen", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/USBHost_t36/utility", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/UTFT", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/VirtualWire", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/WS2812Serial", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XBee", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/XPT2046_Touchscreen", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/i2c_t3", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ks0108", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/ssd1351", - "/Users/vpalmerio/.platformio/packages/framework-arduinoteensy/libraries/x10", - "" - ] - }, - "defines": [ - "PLATFORMIO=60111", - "__IMXRT1062__", - "ARDUINO_TEENSY41", - "USB_SERIAL", - "ARDUINO=10805", - "TEENSYDUINO=158", - "CORE_TEENSY", - "F_CPU=600000000", - "LAYOUT_US_ENGLISH", - "" - ], - "cppStandard": "gnu++14", - "compilerPath": "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin/arm-none-eabi-gcc", - "compilerArgs": [ - "-mthumb", - "-mcpu=cortex-m7", - "-mfloat-abi=hard", - "-mfpu=fpv5-d16", - "" - ] - } - ], - "version": 4 -} diff --git a/ASTRA/testing/IMU_Debug/.vscode/extensions.json b/ASTRA/testing/IMU_Debug/.vscode/extensions.json deleted file mode 100644 index 080e70d..0000000 --- a/ASTRA/testing/IMU_Debug/.vscode/extensions.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - // See http://go.microsoft.com/fwlink/?LinkId=827846 - // for the documentation about the extensions.json format - "recommendations": [ - "platformio.platformio-ide" - ], - "unwantedRecommendations": [ - "ms-vscode.cpptools-extension-pack" - ] -} diff --git a/ASTRA/testing/IMU_Debug/.vscode/launch.json b/ASTRA/testing/IMU_Debug/.vscode/launch.json deleted file mode 100644 index fd1d0d8..0000000 --- a/ASTRA/testing/IMU_Debug/.vscode/launch.json +++ /dev/null @@ -1,44 +0,0 @@ -// AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY -// -// PIO Unified Debugger -// -// Documentation: https://docs.platformio.org/page/plus/debugging.html -// Configuration: https://docs.platformio.org/page/projectconf/section_env_debug.html - -{ - "version": "0.2.0", - "configurations": [ - { - "type": "platformio-debug", - "request": "launch", - "name": "PIO Debug", - "executable": "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/build/teensy41/firmware.elf", - "projectEnvName": "teensy41", - "toolchainBinDir": "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin", - "internalConsoleOptions": "openOnSessionStart", - "preLaunchTask": { - "type": "PlatformIO", - "task": "Pre-Debug" - } - }, - { - "type": "platformio-debug", - "request": "launch", - "name": "PIO Debug (skip Pre-Debug)", - "executable": "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/build/teensy41/firmware.elf", - "projectEnvName": "teensy41", - "toolchainBinDir": "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin", - "internalConsoleOptions": "openOnSessionStart" - }, - { - "type": "platformio-debug", - "request": "launch", - "name": "PIO Debug (without uploading)", - "executable": "/Users/vpalmerio/Documents/Purdue Clubs/PSP Active Controls/ASTRAFlightSoftware/lib/drivers/ASTRA/testing/IMU_Debug/.pio/build/teensy41/firmware.elf", - "projectEnvName": "teensy41", - "toolchainBinDir": "/Users/vpalmerio/.platformio/packages/toolchain-gccarmnoneeabi-teensy/bin", - "internalConsoleOptions": "openOnSessionStart", - "loadMode": "manual" - } - ] -} From 166d66633f44d917ebadedc2d90a6ce91ea7697d Mon Sep 17 00:00:00 2001 From: vpalmerio Date: Sun, 19 Nov 2023 22:19:44 -0600 Subject: [PATCH 39/49] Added IMU calibration values to IMU.cpp --- ASTRA/IMU/src/IMU.cpp | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/ASTRA/IMU/src/IMU.cpp b/ASTRA/IMU/src/IMU.cpp index 6575d6d..aeda5b1 100644 --- a/ASTRA/IMU/src/IMU.cpp +++ b/ASTRA/IMU/src/IMU.cpp @@ -13,26 +13,30 @@ float roll, pitch, heading = 0; float gx, gy, gz = 0; //degrees per second on gyro float qw, qx, qy, qz = 0; //quaternarion +//loads a predetermined calibration into the EEPROM int loadPresetCalibration() { - cal.mag_hardiron[0] = 0.0; - cal.mag_hardiron[1] = 0.0; - cal.mag_hardiron[2] = 0.0; + //Magnetic Hard Offset + cal.mag_hardiron[0] = -3.35; + cal.mag_hardiron[1] = -0.74; + cal.mag_hardiron[2] = -40.79; + //Magnetic Soft Offset // in uTesla - cal.mag_softiron[0] = 1.0; - cal.mag_softiron[1] = 0.0; - cal.mag_softiron[2] = 0.0; - cal.mag_softiron[3] = 0.0; - cal.mag_softiron[4] = 1.0; + cal.mag_softiron[0] = 0.96; + cal.mag_softiron[1] = 0.02; + cal.mag_softiron[2] = 0.01; + cal.mag_softiron[3] = 0.02; + cal.mag_softiron[4] = 0.96; cal.mag_softiron[5] = 0.0; - cal.mag_softiron[6] = 0.0; + cal.mag_softiron[6] = 0.01; cal.mag_softiron[7] = 0.0; - cal.mag_softiron[8] = 1.0; + cal.mag_softiron[8] = 1.08; + //Gyro zero rate offset // in Radians/s - cal.gyro_zerorate[0] = 0.0; - cal.gyro_zerorate[1] = 0.0; - cal.gyro_zerorate[2] = 0.0; + cal.gyro_zerorate[0] = 0.05; + cal.gyro_zerorate[1] = -0.01; + cal.gyro_zerorate[2] = -0.01; cal.saveCalibration(); @@ -82,6 +86,7 @@ int initalizeIMU() { return NO_ERROR_CODE; } +//sets varaibles declared in IMU.h based on latest data IMU int updateIMU() { // Read the motion sensors From db3e8fe78babdad57e6ca0c9890f79ad680eb5ac Mon Sep 17 00:00:00 2001 From: vpalmerio Date: Thu, 23 Nov 2023 11:48:55 -0600 Subject: [PATCH 40/49] Fixed spelling of initializeIMU function --- ASTRA/IMU/src/IMU.cpp | 12 ++++++++++-- ASTRA/IMU/src/IMU.h | 5 +++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ASTRA/IMU/src/IMU.cpp b/ASTRA/IMU/src/IMU.cpp index aeda5b1..ad12ced 100644 --- a/ASTRA/IMU/src/IMU.cpp +++ b/ASTRA/IMU/src/IMU.cpp @@ -8,11 +8,19 @@ Description: Function definititions for declarations in IMU.h Author: Vincent Palmerio Last updated: 11/4/2023 */ - +float* values; float roll, pitch, heading = 0; float gx, gy, gz = 0; //degrees per second on gyro float qw, qx, qy, qz = 0; //quaternarion +float* getValues() { + values = (float*)malloc(3 * sizeof(float)); + values[0] = roll; + values[1] = pitch; + values[2] = heading; + return values; +} + //loads a predetermined calibration into the EEPROM int loadPresetCalibration() { //Magnetic Hard Offset @@ -44,7 +52,7 @@ int loadPresetCalibration() { } -int initalizeIMU() { +int initializeIMU() { Serial.begin(115200); while (!Serial) yield(); diff --git a/ASTRA/IMU/src/IMU.h b/ASTRA/IMU/src/IMU.h index b9863f6..7c389e7 100644 --- a/ASTRA/IMU/src/IMU.h +++ b/ASTRA/IMU/src/IMU.h @@ -42,7 +42,7 @@ Last updated: 11/4/2023 #define PRINT_EVERY_N_UPDATES 10 //#define AHRS_DEBUG_OUTPUT - +extern float* values; extern float roll, pitch, heading; extern float gx, gy, gz; //degrees per second on gyro extern float qw, qx, qy, qz; //quaternarion @@ -50,9 +50,10 @@ extern float qw, qx, qy, qz; //quaternarion // slower == better quality output static Adafruit_NXPSensorFusion filter; // slowest -extern int initalizeIMU(); +extern int initializeIMU(); extern int updateIMU(); extern int loadPresetCalibration(); +extern float* getValues(); #endif From 3035196873d2366c741c47c463b5916534d43f26 Mon Sep 17 00:00:00 2001 From: vpalmerio Date: Thu, 23 Nov 2023 20:28:36 -0600 Subject: [PATCH 41/49] Added .DS_Store to git ignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1617603..73adc3e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .vscode/settings.json .pio +.DS_Store \ No newline at end of file From 9f09f56186a512c93c47bb7189b04397f4c0e56e Mon Sep 17 00:00:00 2001 From: vpalmerio Date: Thu, 23 Nov 2023 20:32:54 -0600 Subject: [PATCH 42/49] Fixed memory leak in IMU and Buffer integration --- ASTRA/IMU/src/IMU.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ASTRA/IMU/src/IMU.cpp b/ASTRA/IMU/src/IMU.cpp index ad12ced..ad74cdb 100644 --- a/ASTRA/IMU/src/IMU.cpp +++ b/ASTRA/IMU/src/IMU.cpp @@ -8,13 +8,12 @@ Description: Function definititions for declarations in IMU.h Author: Vincent Palmerio Last updated: 11/4/2023 */ -float* values; +float* values = (float*)malloc(3 * sizeof(float)); float roll, pitch, heading = 0; float gx, gy, gz = 0; //degrees per second on gyro float qw, qx, qy, qz = 0; //quaternarion float* getValues() { - values = (float*)malloc(3 * sizeof(float)); values[0] = roll; values[1] = pitch; values[2] = heading; @@ -130,9 +129,9 @@ int updateIMU() { #if defined(ASTRA_FULL_DEBUG) or defined(ASTRA_IMU_DEBUG) - Serial.print("I2C took "); Serial.print(millis()-timestamp); Serial.println(" ms"); + //Serial.print("I2C took "); Serial.print(millis()-timestamp); Serial.println(" ms"); - Serial.print("Update took "); Serial.print(millis()-timestamp); Serial.println(" ms"); + //Serial.print("Update took "); Serial.print(millis()-timestamp); Serial.println(" ms"); Serial.print("Raw: "); Serial.print(accel.acceleration.x, 4); Serial.print(", "); @@ -160,7 +159,7 @@ int updateIMU() { Serial.print(qy, 4); Serial.print(", "); Serial.println(qz, 4); - Serial.print("Took "); Serial.print(millis()-timestamp); Serial.println(" ms"); + //Serial.print("Took "); Serial.print(millis()-timestamp); Serial.println(" ms"); #endif From a6768f87302b3da350bb1b56339b63a234daa54f Mon Sep 17 00:00:00 2001 From: vpalmerio Date: Thu, 23 Nov 2023 20:33:58 -0600 Subject: [PATCH 43/49] Created proper debugging println's for IMU's fusion and raw values --- ASTRA/testing/IMU_Debug/src/main.cpp | 50 ++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/ASTRA/testing/IMU_Debug/src/main.cpp b/ASTRA/testing/IMU_Debug/src/main.cpp index 30d457f..b79f86e 100644 --- a/ASTRA/testing/IMU_Debug/src/main.cpp +++ b/ASTRA/testing/IMU_Debug/src/main.cpp @@ -1,11 +1,57 @@ #include "../../../IMU/src/IMU.h" +Adafruit_LSM6DSOX sox; + void setup() { - initalizeIMU(); + initializeIMU(); + + if (!sox.begin_I2C()) { + // if (!sox.begin_SPI(LSM_CS)) { + // if (!sox.begin_SPI(LSM_CS, LSM_SCK, LSM_MISO, LSM_MOSI)) { + // Serial.println("Failed to find LSM6DSOX chip"); + while (1) { + delay(10); + } + } } void loop() { + updateIMU(); - Serial.print("test"); + Serial.print("Fusion values: "); Serial.print(heading); + Serial.print(" "); + Serial.print(roll); + Serial.print(" "); + Serial.print(pitch); + Serial.println(); + + + sensors_event_t accel; + sensors_event_t gyro; + sensors_event_t temp; + sox.getEvent(&accel, &gyro, &temp); + + Serial.print(millis(),7); + Serial.print(","); + + Serial.print(temp.temperature,7); + Serial.print(","); + + /* Display the results (acceleration is measured in m/s^2) */ + Serial.print(accel.acceleration.x,7); + Serial.print(","); + Serial.print(accel.acceleration.y,7); + Serial.print(","); + Serial.print(accel.acceleration.z,7); + Serial.print(","); + + /* Display the results (rotation is measured in rad/s) */ + Serial.print(gyro.gyro.x,7); + Serial.print(","); + Serial.print(gyro.gyro.y,7); + Serial.print(","); + Serial.print(gyro.gyro.z,7); + Serial.println(); + } \ No newline at end of file From 8bda1c08be0b61b055b70a9f0a14d10c1208f7d1 Mon Sep 17 00:00:00 2001 From: vpalmerio Date: Thu, 23 Nov 2023 20:34:55 -0600 Subject: [PATCH 44/49] Removed .DS_Store files --- .DS_Store | Bin 6148 -> 0 bytes ASTRA/.DS_Store | Bin 6148 -> 0 bytes ASTRA/IMU/.DS_Store | Bin 6148 -> 0 bytes ASTRA/IMU/src/.DS_Store | Bin 6148 -> 0 bytes 4 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store delete mode 100644 ASTRA/.DS_Store delete mode 100644 ASTRA/IMU/.DS_Store delete mode 100644 ASTRA/IMU/src/.DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 64edd318cde3bc3c3db50eef2dc95bc03be2c25e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKL2uJA6n<{IEzyM314z3dS>jraFghf}B`w{7!wy>}IE<+@q=IN!JT>Whs4C?Q z|AD{2m0z;I!@g&GC|$>K(?EXG^XELj&xt=77Jh)hsGU<+SLJCdd4Aq*NAP*GKXDbUYijAHP+3IZE^KL=)0v zjFgWb(mYYKzMAGqp}CQ1@O;l7wzuZ-C$?Yk@MF(K}U99zFI7N@5!_0Zw`m2 z*;%f>>2D^1wW;lq#cTMEN^L|J(In4Q{smEHG--hGAJkSfEAkUwSHy>Ed&nEmK5(1P zC|PERr#BcaDrrmwmCJd$=N~n#L38F5a0)mD?nnWf%lL!sE(kb8+SXQ8E9@~8W@BRJ$zf5vZP64ODf2DwE4WdCGL$YV<%Ha5{ tmGDn+HqNUI{-L0vk7DHVQM?7$hPdPkFtk`1Ljt@6XISUL(Wg*v}cBGGe~YKoEjDMqmCWKI~6uijgplli!5I0hU8^TPn04;qy)5G*b7 z(Se3b0K_T|vtXNQ3ChuefnaG7Jt)eiBHC0XC5E!;IIblw5G*a)bWl=!D0#Dz3PthT z@%fs=K?N3_bqqKLCK;&MZiDXsz5mz$lS!`U7;p@HC}c diff --git a/ASTRA/IMU/.DS_Store b/ASTRA/IMU/.DS_Store deleted file mode 100644 index 3b556d270ef610d96f78fe37b6069ee31d50aa15..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%TC)s6upzA#3`zjMUhyJ)NMpvnpUd1F##6c;tCcmO5@m~R$ULW9kPfbc@6)- zckm_rPC4@kB67P!6+-t)cg{S{z4n}OW->%1Mzi=GQJ;uBxW-lw#a~R1Yj0S~^=trz z$&u0-<)o;fq`~Hnr>KBlyO*?sbxWy&->=`7OiiOqMHt7&A+CTse~g)FbP;nwB~7u~ zF(vEl)>(s{;=7nqMzbcH_Q1Y=kh_h%1x?p;8rH)%aI9!vp1b$FiO#dMtbG4gwA!5) z8(pvKZF;BSPc;v#Ni{1+lj56heN`%pR`p4AoF?;e|MkAgt4W$Cg$YRG1eEV5X&$Tj zNX_!NG_j!_@OoZv+}~a-hW>CMKlr=Lfn0pr^#^kJ{^N4l^S0i+{d_e3mHp1urBRFo zej~g{TE7*0#bRUySOHex@f2`7jJNrCDLE4>zzRGQ1@!(P;Ti*n zwMDaapfFbeU<0;hrqq z4MmuzBfm6s5`jf7SpimHU4gc3_VxLH`0xAwdJwl*0aoByDIhur;lT(~a%XE}a{8>5 t@E>q(npa!A4?)Eo#o+3rcpGjE{Zdzefy3G&dSLuVz{tP_EAU?xxB~*%dQAWT diff --git a/ASTRA/IMU/src/.DS_Store b/ASTRA/IMU/src/.DS_Store deleted file mode 100644 index 2a1ceb5a7ce9d474acb6139e161f27e74e920193..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKyH3ME5S)b|BGIIzyf28vADAc8IB@MkhK8H_)*#}mPp`}2x((c^t z&HC&qymtU>_4<4REC9^uj(GDhHD7n1*jZ&9EuOK%5y#E`u-on@?4J`}dx;J1@rWf( z>JMA4_-ozLmmgsq0T%=NC3hN_@86g~SC9fyKnh3!DIf(#3b1Fp&94#_rGONW0)qnn ze`s{auCPyxUk8I9-+g`N=*Dr}C5Wx&U16Wd6`Ex!F-xtk7?$PCx8ik$ePWiwVrM?5 zcDA~qSnSSx3p%VzRFnczV64D-P8Z()@94kW|Hnm|NdYPFuN1J^`eD7|Csl8qe4O{% rMt`Dz8M#4c7##vQ@m73&!fQSzuPf{mqn!CDC+Z;Jy2zx!UnuYiP9G)y From 63945a2a932616979de2ea154f9f698c4e442e58 Mon Sep 17 00:00:00 2001 From: vpalmerio Date: Tue, 28 Nov 2023 19:53:17 -0500 Subject: [PATCH 45/49] IMU.h now has external filtered linear acceleration values --- ASTRA/IMU/src/IMU.cpp | 8 +++++--- ASTRA/IMU/src/IMU.h | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ASTRA/IMU/src/IMU.cpp b/ASTRA/IMU/src/IMU.cpp index ad74cdb..6a4514f 100644 --- a/ASTRA/IMU/src/IMU.cpp +++ b/ASTRA/IMU/src/IMU.cpp @@ -9,14 +9,15 @@ Author: Vincent Palmerio Last updated: 11/4/2023 */ float* values = (float*)malloc(3 * sizeof(float)); -float roll, pitch, heading = 0; +float filteredGX, filteredGY, filteredGZ; +float roll, pitch, yaw = 0; float gx, gy, gz = 0; //degrees per second on gyro float qw, qx, qy, qz = 0; //quaternarion float* getValues() { values[0] = roll; values[1] = pitch; - values[2] = heading; + values[2] = yaw; return values; } @@ -120,12 +121,13 @@ int updateIMU() { // print the heading, pitch and roll roll = filter.getRoll(); pitch = filter.getPitch(); - heading = filter.getYaw(); + yaw = filter.getYaw(); //float qw, qx, qy, qz; filter.getQuaternion(&qw, &qx, &qy, &qz); + filter.getLinearAcceleration(&filteredGX, &filteredGY, &filteredGZ); #if defined(ASTRA_FULL_DEBUG) or defined(ASTRA_IMU_DEBUG) diff --git a/ASTRA/IMU/src/IMU.h b/ASTRA/IMU/src/IMU.h index 7c389e7..847e330 100644 --- a/ASTRA/IMU/src/IMU.h +++ b/ASTRA/IMU/src/IMU.h @@ -43,7 +43,8 @@ Last updated: 11/4/2023 //#define AHRS_DEBUG_OUTPUT extern float* values; -extern float roll, pitch, heading; +extern float roll, pitch, yaw; +extern float filteredGX, filteredGY, filteredGZ; extern float gx, gy, gz; //degrees per second on gyro extern float qw, qx, qy, qz; //quaternarion From de8140e3c91689189b2dfe2df95485c63eb13fcd Mon Sep 17 00:00:00 2001 From: vpalmerio Date: Sat, 2 Dec 2023 14:55:47 -0500 Subject: [PATCH 46/49] Added linearAccelVector to IMU lib --- ASTRA/IMU/src/IMU.cpp | 17 ++++++++++++----- ASTRA/IMU/src/IMU.h | 5 ++++- ASTRA/testing/IMU_Debug/platformio.ini | 1 + 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ASTRA/IMU/src/IMU.cpp b/ASTRA/IMU/src/IMU.cpp index 6a4514f..ff95788 100644 --- a/ASTRA/IMU/src/IMU.cpp +++ b/ASTRA/IMU/src/IMU.cpp @@ -9,7 +9,8 @@ Author: Vincent Palmerio Last updated: 11/4/2023 */ float* values = (float*)malloc(3 * sizeof(float)); -float filteredGX, filteredGY, filteredGZ; +Eigen::VectorXd linearAccelVector(3); +float linearAccelX, linearAccelY, linearAccelZ = 0; float roll, pitch, yaw = 0; float gx, gy, gz = 0; //degrees per second on gyro float qw, qx, qy, qz = 0; //quaternarion @@ -56,6 +57,10 @@ int initializeIMU() { Serial.begin(115200); while (!Serial) yield(); + for (int i = 0; i < linearAccelVector.size(); i++) { + linearAccelVector(i) = 0; + } + if (!cal.begin()) { //Failed to initialize calibration helper #if defined(ASTRA_FULL_DEBUG) or defined(ASTRA_IMU_DEBUG) @@ -109,9 +114,9 @@ int updateIMU() { // Gyroscope needs to be converted from Rad/s to Degree/s // the rest are not unit-important - gx = gyro.gyro.x * SENSORS_RADS_TO_DPS; - gy = gyro.gyro.y * SENSORS_RADS_TO_DPS; - gz = gyro.gyro.z * SENSORS_RADS_TO_DPS; + gx = gyro.gyro.x; //* SENSORS_RADS_TO_DPS; //omega x + gy = gyro.gyro.y; //* SENSORS_RADS_TO_DPS; //omega y + gz = gyro.gyro.z; //* SENSORS_RADS_TO_DPS; //omega z // Update the SensorFusion filter filter.update(gx, gy, gz, @@ -127,7 +132,9 @@ int updateIMU() { //float qw, qx, qy, qz; filter.getQuaternion(&qw, &qx, &qy, &qz); - filter.getLinearAcceleration(&filteredGX, &filteredGY, &filteredGZ); + filter.getLinearAcceleration(&linearAccelX, &linearAccelY, &linearAccelZ); //"a" - linear acceleration + + linearAccelVector << linearAccelX, linearAccelY, linearAccelZ; #if defined(ASTRA_FULL_DEBUG) or defined(ASTRA_IMU_DEBUG) diff --git a/ASTRA/IMU/src/IMU.h b/ASTRA/IMU/src/IMU.h index 847e330..de677f3 100644 --- a/ASTRA/IMU/src/IMU.h +++ b/ASTRA/IMU/src/IMU.h @@ -16,6 +16,8 @@ Last updated: 11/4/2023 #include #include +#include + //uncomment to print data to console for just IMU //#define ASTRA_IMU_DEBUG @@ -44,7 +46,8 @@ Last updated: 11/4/2023 extern float* values; extern float roll, pitch, yaw; -extern float filteredGX, filteredGY, filteredGZ; +extern Eigen::VectorXd linearAccelVector; +extern float linearAccelX, linearAccelY, linearAccelZ; extern float gx, gy, gz; //degrees per second on gyro extern float qw, qx, qy, qz; //quaternarion diff --git a/ASTRA/testing/IMU_Debug/platformio.ini b/ASTRA/testing/IMU_Debug/platformio.ini index 38b79c6..5460d45 100644 --- a/ASTRA/testing/IMU_Debug/platformio.ini +++ b/ASTRA/testing/IMU_Debug/platformio.ini @@ -14,6 +14,7 @@ board = teensy41 framework = arduino lib_extra_dirs = ../../IMU lib_deps = + hideakitai/ArduinoEigen@^0.3.0 adafruit/Adafruit LSM6DS@^4.7.0 adafruit/Adafruit LIS3MDL@^1.2.1 adafruit/Adafruit AHRS@^2.3.3 From 20cb4f93531bd7bf43d6169a0b5e8dcd4e6ed146 Mon Sep 17 00:00:00 2001 From: vpalmerio Date: Sat, 2 Dec 2023 22:04:42 -0500 Subject: [PATCH 47/49] Added and updated docstrings for most files --- ASTRA/IMU/include/LSM6DS_LIS3MDL.h | 1 - ASTRA/IMU/src/IMU.cpp | 2 +- ASTRA/IMU/src/IMU.h | 1 - ASTRA/error/DriverError.h | 2 -- ASTRA/testing/IMU_Debug/src/main.cpp | 8 +++++++- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ASTRA/IMU/include/LSM6DS_LIS3MDL.h b/ASTRA/IMU/include/LSM6DS_LIS3MDL.h index d9bb782..dc4d98a 100644 --- a/ASTRA/IMU/include/LSM6DS_LIS3MDL.h +++ b/ASTRA/IMU/include/LSM6DS_LIS3MDL.h @@ -3,7 +3,6 @@ LSM6DS_LIS3MDL.h Description: Header file for sensor-setup function definitions Author: Vincent Palmerio, (Original: https://github.com/adafruit/Adafruit_AHRS/blob/master/examples/calibrated_orientation/calibrated_orientation.ino) -Last updated: 11/4/2023 */ #ifndef LSM6DS_LIS3MDL diff --git a/ASTRA/IMU/src/IMU.cpp b/ASTRA/IMU/src/IMU.cpp index ff95788..c19d380 100644 --- a/ASTRA/IMU/src/IMU.cpp +++ b/ASTRA/IMU/src/IMU.cpp @@ -6,8 +6,8 @@ IMU.cpp Description: Function definititions for declarations in IMU.h Author: Vincent Palmerio -Last updated: 11/4/2023 */ + float* values = (float*)malloc(3 * sizeof(float)); Eigen::VectorXd linearAccelVector(3); float linearAccelX, linearAccelY, linearAccelZ = 0; diff --git a/ASTRA/IMU/src/IMU.h b/ASTRA/IMU/src/IMU.h index de677f3..c83ac94 100644 --- a/ASTRA/IMU/src/IMU.h +++ b/ASTRA/IMU/src/IMU.h @@ -3,7 +3,6 @@ IMU.h - Header file for the IMU Driver Description: Contains all functions and variables to interact with the IMU Author: Vincent Palmerio -Last updated: 11/4/2023 */ #ifndef IMU_H diff --git a/ASTRA/error/DriverError.h b/ASTRA/error/DriverError.h index f4e0a2b..e1a3ab5 100644 --- a/ASTRA/error/DriverError.h +++ b/ASTRA/error/DriverError.h @@ -2,8 +2,6 @@ DriverError.h - Error Header/Constants File for Drivers Description: Error Constants for all Driver Errors that occur Author: Vincent Palmerio -Created: 10/2/2023 -Last updated: 10/2/2023 */ #ifndef DRIVER_ERROR_H diff --git a/ASTRA/testing/IMU_Debug/src/main.cpp b/ASTRA/testing/IMU_Debug/src/main.cpp index b79f86e..4d13acf 100644 --- a/ASTRA/testing/IMU_Debug/src/main.cpp +++ b/ASTRA/testing/IMU_Debug/src/main.cpp @@ -1,5 +1,11 @@ #include "../../../IMU/src/IMU.h" +/* +main.cpp +Description: Main file for running testing code for the IMU driver +Author: Vincent Palmerio +*/ + Adafruit_LSM6DSOX sox; void setup() { @@ -19,7 +25,7 @@ void loop() { updateIMU(); Serial.print("Fusion values: "); - Serial.print(heading); + Serial.print(yaw); Serial.print(" "); Serial.print(roll); Serial.print(" "); From 407f4a4f3e6e7157ab212ddd530a16e45d4423ea Mon Sep 17 00:00:00 2001 From: Siddharth Goel Date: Wed, 10 Jan 2024 19:48:34 -0500 Subject: [PATCH 48/49] Made changes to getValues in IMU.cpp --- ASTRA/IMU/src/IMU.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ASTRA/IMU/src/IMU.cpp b/ASTRA/IMU/src/IMU.cpp index c19d380..414dc0c 100644 --- a/ASTRA/IMU/src/IMU.cpp +++ b/ASTRA/IMU/src/IMU.cpp @@ -8,7 +8,7 @@ Description: Function definititions for declarations in IMU.h Author: Vincent Palmerio */ -float* values = (float*)malloc(3 * sizeof(float)); + Eigen::VectorXd linearAccelVector(3); float linearAccelX, linearAccelY, linearAccelZ = 0; float roll, pitch, yaw = 0; @@ -16,6 +16,7 @@ float gx, gy, gz = 0; //degrees per second on gyro float qw, qx, qy, qz = 0; //quaternarion float* getValues() { + float* values = (float*)malloc(3 * sizeof(float)); values[0] = roll; values[1] = pitch; values[2] = yaw; From 43b983519ccfef626b02ecc1c5cc646d0fac2974 Mon Sep 17 00:00:00 2001 From: Vincent Palmerio <62448074+vpalmerio@users.noreply.github.com> Date: Sat, 13 Apr 2024 12:41:53 -0500 Subject: [PATCH 49/49] Create README.md for IMU driver --- ASTRA/IMU/README.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 ASTRA/IMU/README.md diff --git a/ASTRA/IMU/README.md b/ASTRA/IMU/README.md new file mode 100644 index 0000000..8393aae --- /dev/null +++ b/ASTRA/IMU/README.md @@ -0,0 +1,5 @@ +# PLEASE READ + +This code is for the driver of the IMU. The structure used to be that this github repository was a submodule of the ASTRAFlightSoftware Repository. +However, this caused confusion among new developers on how to actually update the IMU driver. We no longer use this submodule structure, and thus, the code +for the IMU in this repository is unused and out of date. It is kept here only for old branches in ASTRAFlightSoftware. Do not use this code for any other reason.