diff --git a/lib/bno080/BNO080.cpp b/lib/bno080/BNO080.cpp index e41ec0c..9a69362 100644 --- a/lib/bno080/BNO080.cpp +++ b/lib/bno080/BNO080.cpp @@ -19,7 +19,24 @@ Arduino IDE 1.8.5 SparkFun code, firmware, and software is released under the MIT License. - Please see LICENSE.md for further details. + + 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. */ #include "BNO080.h" diff --git a/lib/bno080/BNO080.h b/lib/bno080/BNO080.h index 025f9c8..07202b7 100644 --- a/lib/bno080/BNO080.h +++ b/lib/bno080/BNO080.h @@ -18,8 +18,25 @@ Development environment specifics: Arduino IDE 1.8.3 - SparkFun code, firmware, and software is released under the MIT License. - Please see LICENSE.md for further details. + SparkFun code, firmware, and software is released under the MIT License. + + 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. */ #pragma once diff --git a/lib/ota/ota.cpp b/lib/ota/ota.cpp index a2f0506..3df50d8 100644 --- a/lib/ota/ota.cpp +++ b/lib/ota/ota.cpp @@ -1,3 +1,26 @@ +/* + SlimeVR Code is placed under the MIT license + Copyright (c) 2021 Eiren Rain + + 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. +*/ + #include "ota.h" void otaSetup(const char * const otaPassword) { diff --git a/lib/ota/ota.h b/lib/ota/ota.h index 88f07ef..874336c 100644 --- a/lib/ota/ota.h +++ b/lib/ota/ota.h @@ -1,3 +1,26 @@ +/* + SlimeVR Code is placed under the MIT license + Copyright (c) 2021 Eiren Rain + + 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. +*/ + #ifndef _OTA_H_ #define _OTA_H 1 diff --git a/src/bno080sensor.cpp b/src/bno080sensor.cpp index a33110b..6159a6e 100644 --- a/src/bno080sensor.cpp +++ b/src/bno080sensor.cpp @@ -1,3 +1,26 @@ +/* + SlimeVR Code is placed under the MIT license + Copyright (c) 2021 Eiren Rain + + 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. +*/ + #include "BNO080.h" #include "sensor.h" #include "udpclient.h" diff --git a/src/configuration.cpp b/src/configuration.cpp index b6711e2..0274110 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -1,3 +1,26 @@ +/* + SlimeVR Code is placed under the MIT license + Copyright (c) 2021 Eiren Rain + + 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. +*/ + #include #include "configuration.h" diff --git a/src/configuration.h b/src/configuration.h index 30f8665..02782e8 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -1,3 +1,26 @@ +/* + SlimeVR Code is placed under the MIT license + Copyright (c) 2021 Eiren Rain + + 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. +*/ + #ifndef _OWO_CONFIG_H_ #define _OWO_CONFIG_H_ diff --git a/src/credentials.h b/src/credentials.h index e4fd8d8..f60a242 100644 --- a/src/credentials.h +++ b/src/credentials.h @@ -1 +1,24 @@ -const char* otaPassword = ""; // YOUR OTA PASSWORD HERE, LEAVE EMPTY FRO NO OTA UPDATES \ No newline at end of file +/* + SlimeVR Code is placed under the MIT license + Copyright (c) 2021 Eiren Rain + + 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. +*/ + +const char* otaPassword = ""; // YOUR OTA PASSWORD HERE, LEAVE EMPTY TO DISABLE OTA UPDATES \ No newline at end of file diff --git a/src/defines.h b/src/defines.h index 98b9254..74792a3 100644 --- a/src/defines.h +++ b/src/defines.h @@ -1,17 +1,24 @@ /* - Hardware setup: - MPU9250 Breakout --------- Adafruit Huzzah - VDD ---------------------- 3.3V - VDDI --------------------- 3.3V - SDA ----------------------- Pin4 - SCL ----------------------- Pin5 - GND ---------------------- GND + SlimeVR Code is placed under the MIT license + Copyright (c) 2021 Eiren Rain - EEPROM - Vcc to 3.3V - GND to GND - AO, A1, A2 to GND (on 24LC256 this gives an i2c slave address as 1010000 which is 0x50) - SDA/SCL to Pin4 and Pin5 of Adafruit Huzzah, respectively + 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. */ #define IMU_MPU9250 1 @@ -37,21 +44,15 @@ #define IMU_HAS_MAG false #endif -/////////////////////////////////////////////////////////////////// //Debug information -/////////////////////////////////////////////////////////////////// #define serialDebug false // Set to true to get Serial output for debugging #define serialBaudRate 115200 -/////////////////////////////////////////////////////////////////// -//Determines how often we sample and send data -/////////////////////////////////////////////////////////////////// +// Determines how often we sample and send data #define samplingRateInMillis 10 #define batterySampleRate 10000 -/////////////////////////////////////////////////////////////////// -//Setup for the Magnetometer -/////////////////////////////////////////////////////////////////// +// Setup for the Magnetometer #define useFullCalibrationMatrix true #define sensorIdTime 1000 diff --git a/src/main.cpp b/src/main.cpp index 1217ea7..9e3ea58 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,22 +1,25 @@ -// -// MPU-9250 Mahony AHRS S.J. Remington 3/2020 -// last update 12/17/2020 -// added full matrix calibration for accel and mag +/* + SlimeVR Code is placed under the MIT license + Copyright (c) 2021 Eiren Rain -// ***Standard orientation defined by gyro/accel: X North Y West Z Up*** + 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: -// VERY VERY IMPORTANT! -// Both the accelerometer and magnetometer MUST be properly calibrated for this program to work, and the gyro offset must be determned. -// Follow the procedure described in http://sailboatinstruments.blogspot.com/2011/08/improved-magnetometer-calibration.html -// or in more detail, the tutorial https://thecavepearlproject.org/2015/05/22/calibrating-any-compass-or-accelerometer-for-arduino/ -// -// To collect data for calibration, use the companion programs MPU9250_cal and Magneto 1.2 from sailboatinstruments.blogspot.com -// -// For correcting the data, below I use the diagonal element of matrix A and ignore -// the off diagonal components. If those terms are large, (most likely only for the magnetometer) -// add them in to the corrections in function get_MPU_scaled() -// -// This version must be compiled with library routines in subfolder "libs" + 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. +*/ #include "Wire.h" #include "ota.h" diff --git a/src/mpu6050sensor.cpp b/src/mpu6050sensor.cpp index e676a63..284a620 100644 --- a/src/mpu6050sensor.cpp +++ b/src/mpu6050sensor.cpp @@ -1,3 +1,26 @@ +/* + SlimeVR Code is placed under the MIT license + Copyright (c) 2021 Eiren Rain + + 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. +*/ + #include "MPU9250.h" #include "sensor.h" #include "udpclient.h" diff --git a/src/mpu9250sensor.cpp b/src/mpu9250sensor.cpp index 2aaf487..56b00f4 100644 --- a/src/mpu9250sensor.cpp +++ b/src/mpu9250sensor.cpp @@ -1,3 +1,26 @@ +/* + SlimeVR Code is placed under the MIT license + Copyright (c) 2021 Eiren Rain, S.J. Remington + + 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. +*/ + #include "MPU9250.h" #include "sensor.h" #include "udpclient.h" diff --git a/src/sensor.h b/src/sensor.h index e394708..f60ccd9 100644 --- a/src/sensor.h +++ b/src/sensor.h @@ -1,3 +1,26 @@ +/* + SlimeVR Code is placed under the MIT license + Copyright (c) 2021 Eiren Rain + + 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. +*/ + #ifndef _SENSOR_H_ #define _SENSOR_H_ 1 diff --git a/src/udpclient.cpp b/src/udpclient.cpp index dfdad1d..54fc7dd 100644 --- a/src/udpclient.cpp +++ b/src/udpclient.cpp @@ -1,3 +1,26 @@ +/* + SlimeVR Code is placed under the MIT license + Copyright (c) 2021 Eiren Rain + + 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. +*/ + #include "udpclient.h" #include "configuration.h" #include "defines.h" diff --git a/src/udpclient.h b/src/udpclient.h index fce0105..c5ac6db 100644 --- a/src/udpclient.h +++ b/src/udpclient.h @@ -1,3 +1,26 @@ +/* + SlimeVR Code is placed under the MIT license + Copyright (c) 2021 Eiren Rain + + 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. +*/ + #ifndef _UDP_CLIENT_H_ #define _UDP_CLIENT_H_ diff --git a/src/wificredentials.h b/src/wificredentials.h index ee9c7ce..4ab1eea 100644 --- a/src/wificredentials.h +++ b/src/wificredentials.h @@ -1,5 +1,33 @@ -// Credentials +/* + SlimeVR Code is placed under the MIT license + Copyright (c) 2021 Eiren Rain + + 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. +*/ + +#ifndef _WIFICREDENTIALS_H_ +#define _WIFICREDENTIALS_H_ 1 + +// Default wifi credentials char* networkName = ""; char* networkPassword = ""; char* host = ""; -int port = 6969; \ No newline at end of file +int port = 6969; + +#endif // _WIFICREDENTIALS_H_ \ No newline at end of file diff --git a/test/calibrate.cpp b/test/calibrate.cpp deleted file mode 100644 index ca629b2..0000000 --- a/test/calibrate.cpp +++ /dev/null @@ -1,130 +0,0 @@ -// program to collect raw data from MPU9250 accel and magnetometer for later correction. -// output in form suitable for .csv file -// Use Magneto 1.2 to calculate corrections for BOTH accelerometer and magnetometer -// http://sailboatinstruments.blogspot.com/2011/09/improved-magnetometer-calibration-part.html -// S. J. Remington 3/2020 - -//USAGE: -// 1. Allow the sensor to sit still upon program startup for gyro bias data collection. -// 2. TURN THE SENSOR VERY SLOWLY AND CAREFULLY DURING DATA COLLECTION TO AVOID EXCESS ACCELERATION! - -#include "Wire.h" -// I2Cdev and MPU9250 must be installed as libraries, or else the .cpp/.h files -// for both classes must be in the include path of your project -#include "I2Cdev.cpp" -#include "MPU9250.cpp" -#include "defines.h" - -// class default I2C address is 0x68 -// specific I2C addresses may be passed as a parameter here -// AD0 low = 0x68 (default for InvenSense evaluation board) -// AD0 high = 0x69 -MPU9250 imu; -I2Cdev I2C_M; - -#define sample_num 300 //acc/mag scaling points to collect - -uint8_t buffer_m[6]; //six points mag - -//raw data and scaled as vector -int16_t ax, ay, az; -int16_t gx, gy, gz; -int16_t mx, my, mz; -float Axyz[3] = {0}; -float Gxyz[3] = {0}; -float Mxyz[3] = {0}; - -//previously determined scale and offsets for accel and mag -float A_cal[6] = {0}; // 0..2 scale, 3..5 offsets -float M_cal[6] = {0}; - -void getAcc_Mag_raw(void) -{ - imu.getMotion9(&ax, &ay, &az, &gx, &gy, &gz, &mx, &my, &mz); - Axyz[0] = (float)ax; - Axyz[1] = (float)ay; - Axyz[2] = (float)az; - Mxyz[0] = (float)mx; - Mxyz[1] = (float)my; - Mxyz[2] = (float)mz; -} - -void getGyro_scaled(void) -{ - imu.getMotion9(&ax, &ay, &az, &gx, &gy, &gz, &mx, &my, &mz); - Gxyz[0] = (float)gx * 250 / 32768; //250 LSB(d/s) - Gxyz[1] = (float)gy * 250 / 32768; - Gxyz[2] = (float)gz * 250 / 32768; -} - -int N = sample_num; -void setup() -{ - // join I2C bus (I2Cdev library doesn't do this automatically) - Wire.begin(); - Serial.begin(serialBaudRate); - - // initialize device - Serial.println("Initializing I2C devices..."); - imu.initialize(); - - // verify connection - Serial.println("Testing device connections..."); - Serial.println(imu.testConnection() ? "MPU9250 OK" : "MPU9250 ??"); - Serial.println("Gyro bias collection ... KEEP SENSOR STILL"); - delay(2000); - for (int i = 0; i < N; i++) - { - imu.getMotion9(&ax, &ay, &az, &gx, &gy, &gz, &mx, &my, &mz); - Gxyz[0] += float(gx); - Gxyz[1] += float(gy); - Gxyz[2] += float(gz); - } - Serial.print("Done. Gyro offsets (raw) "); - Serial.print(Gxyz[0] / N, 1); - Serial.print(", "); - Serial.print(Gxyz[1] / N, 1); - Serial.print(", "); - Serial.print(Gxyz[2] / N, 1); - Serial.println(); - - Serial.print("Collecting "); - Serial.print(N); - Serial.println(" points for scaling, 3/second"); - Serial.println("TURN SENSOR VERY SLOWLY AND CAREFULLY IN 3D"); - delay(2000); - - float M_mag = 0, A_mag = 0; - int i, j; - j = N; - while (j-- >= 0) - { - getAcc_Mag_raw(); - for (i = 0; i < 3; i++) - { - M_mag += Mxyz[i] * Mxyz[i]; - A_mag += Axyz[i] * Axyz[i]; - } - Serial.print(ax); - Serial.print(" "); - Serial.print(ay); - Serial.print(" "); - Serial.print(az); - Serial.print(" "); - Serial.print(mx); - Serial.print(" "); - Serial.print(my); - Serial.print(" "); - Serial.println(mz); - delay(300); - } - Serial.print("Done. "); - Serial.print("rms Acc = "); - Serial.print(sqrt(A_mag / N)); - Serial.print(", rms Mag = "); - Serial.println(sqrt(M_mag / N)); -} - -void loop() -{ -} diff --git a/test/i2cscan.cpp b/test/i2cscan.cpp index ab57455..d37d916 100644 --- a/test/i2cscan.cpp +++ b/test/i2cscan.cpp @@ -8,10 +8,11 @@ #include #include -#include "ota.cpp" -#include "configuration.cpp" -#include "util.cpp" -#include "udpclient.cpp" +#include "ota.h" +#include "configuration.h" +#include "helper_3dmath.h" +#include "udpclient.h" +#include "credentials.h" DeviceConfig config; @@ -115,5 +116,5 @@ void setup() { scanPorts(); setUpWiFi(&config); - otaSetup(); + otaSetup(otaPassword); }