From 41917ba6462bec7ac0570edc7bdb0c1204ff8109 Mon Sep 17 00:00:00 2001 From: foglar Date: Wed, 10 Jul 2024 21:17:20 +0200 Subject: [PATCH] update --- .vscode/arduino.json | 4 + .vscode/c_cpp_properties.json | 493 ++++++++++++++++++ .vscode/launch.json | 29 ++ .vscode/settings.json | 5 + arduino-quick-upload | 10 +- sender_module/DEV_Config.cpp | 1 + sender_module/DEV_Config.h | 1 - sender_module/sender_module.ino | 81 ++- sender_module_final/ISSUES.md | 4 + sender_module_final/README.md | 27 + sender_module_final/sender_module_final.ino | 149 +++--- .../serial_communication_test.ino | 0 12 files changed, 677 insertions(+), 127 deletions(-) create mode 100644 .vscode/arduino.json create mode 100644 .vscode/c_cpp_properties.json create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json create mode 100644 sender_module_final/ISSUES.md create mode 100644 sender_module_final/README.md create mode 100644 testing/serial_communication_test/serial_communication_test.ino diff --git a/.vscode/arduino.json b/.vscode/arduino.json new file mode 100644 index 0000000..9ad9b97 --- /dev/null +++ b/.vscode/arduino.json @@ -0,0 +1,4 @@ +{ + "board": "arduino:mbed_nano:nano33ble", + "sketch": "sender_module_final/sender_module_final.ino" +} \ No newline at end of file diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..9d33149 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,493 @@ +{ + "version": 4, + "configurations": [ + { + "name": "Arduino", + "compilerPath": "/home/foglar/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++", + "compilerArgs": [ + "-w", + "-nostdlib" + ], + "intelliSenseMode": "gcc-x64", + "includePath": [ + "/home/foglar/.arduino15/packages/arduino/hardware/mbed_nano/4.1.3/cores/arduino", + "/home/foglar/.arduino15/packages/arduino/hardware/mbed_nano/4.1.3/variants/ARDUINO_NANO33BLE", + "/home/foglar/.arduino15/packages/arduino/hardware/mbed_nano/4.1.3/libraries/SPI", + "/home/foglar/Arduino/libraries/SD/src", + "/home/foglar/Arduino/libraries/Servo/src", + "/home/foglar/Arduino/libraries/Arduino_BMI270_BMM150/src", + "/home/foglar/.arduino15/packages/arduino/hardware/mbed_nano/4.1.3/libraries/Wire", + "/home/foglar/Arduino/libraries/RF24", + "/home/foglar/.arduino15/packages/arduino/hardware/mbed_nano/4.1.3/cores/arduino/api/deprecated", + "/home/foglar/.arduino15/packages/arduino/hardware/mbed_nano/4.1.3/cores/arduino/api/deprecated-avr-comp", + "/home/foglar/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1", + "/home/foglar/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/arm-none-eabi", + "/home/foglar/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/c++/7.2.1/backward", + "/home/foglar/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/lib/gcc/arm-none-eabi/7.2.1/include", + "/home/foglar/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/lib/gcc/arm-none-eabi/7.2.1/include-fixed", + "/home/foglar/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include" + ], + "forcedInclude": [ + "/home/foglar/.arduino15/packages/arduino/hardware/mbed_nano/4.1.3/cores/arduino/Arduino.h" + ], + "cStandard": "c11", + "cppStandard": "c++11", + "defines": [ + "ARDUINO_ARCH_NRF52840", + "ARDUINO=10607", + "ARDUINO_ARDUINO_NANO33BLE", + "ARDUINO_ARCH_MBED_NANO", + "ARDUINO_ARCH_MBED", + "ARDUINO_LIBRARY_DISCOVERY_PHASE=0", + "__DBL_MIN_EXP__=(-1021)", + "__HQ_FBIT__=15", + "__FLT32X_MAX_EXP__=1024", + "__cpp_attributes=200809", + "__UINT_LEAST16_MAX__=0xffff", + "__ARM_SIZEOF_WCHAR_T=4", + "__ATOMIC_ACQUIRE=2", + "__SFRACT_IBIT__=0", + "__FLT_MIN__=1.1754943508222875e-38F", + "__GCC_IEC_559_COMPLEX=0", + "__cpp_aggregate_nsdmi=201304", + "__UFRACT_MAX__=0XFFFFP-16UR", + "__UINT_LEAST8_TYPE__=unsigned char", + "__DQ_FBIT__=63", + "__INTMAX_C(c)=c ## LL", + "__ULFRACT_FBIT__=32", + "__SACCUM_EPSILON__=0x1P-7HK", + "__CHAR_BIT__=8", + "__USQ_IBIT__=0", + "__UINT8_MAX__=0xff", + "__ACCUM_FBIT__=15", + "__WINT_MAX__=0xffffffffU", + "__FLT32_MIN_EXP__=(-125)", + "__cpp_static_assert=200410", + "__USFRACT_FBIT__=8", + "__ORDER_LITTLE_ENDIAN__=1234", + "__SIZE_MAX__=0xffffffffU", + "__ARM_ARCH_ISA_ARM=1", + "__WCHAR_MAX__=0xffffffffU", + "__LACCUM_IBIT__=32", + "__DBL_DENORM_MIN__=double(4.9406564584124654e-324L)", + "__GCC_ATOMIC_CHAR_LOCK_FREE=1", + "__GCC_IEC_559=0", + "__FLT32X_DECIMAL_DIG__=17", + "__FLT_EVAL_METHOD__=0", + "__cpp_binary_literals=201304", + "__LLACCUM_MAX__=0X7FFFFFFFFFFFFFFFP-31LLK", + "__FLT64_DECIMAL_DIG__=17", + "__GCC_ATOMIC_CHAR32_T_LOCK_FREE=1", + "__FRACT_FBIT__=15", + "__cpp_variadic_templates=200704", + "__UINT_FAST64_MAX__=0xffffffffffffffffULL", + "__SIG_ATOMIC_TYPE__=int", + "__UACCUM_FBIT__=16", + "__DBL_MIN_10_EXP__=(-307)", + "__FINITE_MATH_ONLY__=0", + "__ARMEL__=1", + "__cpp_variable_templates=201304", + "__LFRACT_IBIT__=0", + "__GNUC_PATCHLEVEL__=1", + "__FLT32_HAS_DENORM__=1", + "__LFRACT_MAX__=0X7FFFFFFFP-31LR", + "__UINT_FAST8_MAX__=0xffffffffU", + "__has_include(STR)=__has_include__(STR)", + "__DEC64_MAX_EXP__=385", + "__INT8_C(c)=c", + "__INT_LEAST8_WIDTH__=8", + "__UINT_LEAST64_MAX__=0xffffffffffffffffULL", + "__SA_FBIT__=15", + "__SHRT_MAX__=0x7fff", + "__LDBL_MAX__=1.7976931348623157e+308L", + "__FRACT_MAX__=0X7FFFP-15R", + "__UFRACT_FBIT__=16", + "__UFRACT_MIN__=0.0UR", + "__UINT_LEAST8_MAX__=0xff", + "__GCC_ATOMIC_BOOL_LOCK_FREE=1", + "__UINTMAX_TYPE__=long long unsigned int", + "__LLFRACT_EPSILON__=0x1P-63LLR", + "__DEC32_EPSILON__=1E-6DF", + "__FLT_EVAL_METHOD_TS_18661_3__=0", + "__CHAR_UNSIGNED__=1", + "__UINT32_MAX__=0xffffffffUL", + "__GXX_EXPERIMENTAL_CXX0X__=1", + "__ULFRACT_MAX__=0XFFFFFFFFP-32ULR", + "__TA_IBIT__=64", + "__LDBL_MAX_EXP__=1024", + "__WINT_MIN__=0U", + "__INT_LEAST16_WIDTH__=16", + "__ULLFRACT_MIN__=0.0ULLR", + "__SCHAR_MAX__=0x7f", + "__WCHAR_MIN__=0U", + "__INT64_C(c)=c ## LL", + "__DBL_DIG__=15", + "__GCC_ATOMIC_POINTER_LOCK_FREE=1", + "__LLACCUM_MIN__=(-0X1P31LLK-0X1P31LLK)", + "__SIZEOF_INT__=4", + "__SIZEOF_POINTER__=4", + "__GCC_ATOMIC_CHAR16_T_LOCK_FREE=1", + "__USACCUM_IBIT__=8", + "__USER_LABEL_PREFIX__", + "__STDC_HOSTED__=1", + "__LDBL_HAS_INFINITY__=1", + "__LFRACT_MIN__=(-0.5LR-0.5LR)", + "__HA_IBIT__=8", + "__FLT32_DIG__=6", + "__TQ_IBIT__=0", + "__FLT_EPSILON__=1.1920928955078125e-7F", + "__APCS_32__=1", + "__GXX_WEAK__=1", + "__SHRT_WIDTH__=16", + "__USFRACT_IBIT__=0", + "__LDBL_MIN__=2.2250738585072014e-308L", + "__FRACT_MIN__=(-0.5R-0.5R)", + "__DEC32_MAX__=9.999999E96DF", + "__DA_IBIT__=32", + "__ARM_SIZEOF_MINIMAL_ENUM=1", + "__FLT32X_HAS_INFINITY__=1", + "__INT32_MAX__=0x7fffffffL", + "__UQQ_FBIT__=8", + "__INT_WIDTH__=32", + "__SIZEOF_LONG__=4", + "__UACCUM_MAX__=0XFFFFFFFFP-16UK", + "__UINT16_C(c)=c", + "__PTRDIFF_WIDTH__=32", + "__DECIMAL_DIG__=17", + "__LFRACT_EPSILON__=0x1P-31LR", + "__FLT64_EPSILON__=2.2204460492503131e-16F64", + "__ULFRACT_MIN__=0.0ULR", + "__INTMAX_WIDTH__=64", + "__FLT64_MIN_EXP__=(-1021)", + "__has_include_next(STR)=__has_include_next__(STR)", + "__LDBL_HAS_QUIET_NAN__=1", + "__ULACCUM_IBIT__=32", + "__FLT64_MANT_DIG__=53", + "__UACCUM_EPSILON__=0x1P-16UK", + "__GNUC__=7", + "__ULLACCUM_MAX__=0XFFFFFFFFFFFFFFFFP-32ULLK", + "__GXX_RTTI=1", + "__cpp_delegating_constructors=200604", + "__HQ_IBIT__=0", + "__FLT_HAS_DENORM__=1", + "__SIZEOF_LONG_DOUBLE__=8", + "__BIGGEST_ALIGNMENT__=8", + "__STDC_UTF_16__=1", + "__FLT64_MAX_10_EXP__=308", + "__GNUC_STDC_INLINE__=1", + "__DQ_IBIT__=0", + "__FLT32_HAS_INFINITY__=1", + "__DBL_MAX__=double(1.7976931348623157e+308L)", + "__ULFRACT_IBIT__=0", + "__cpp_raw_strings=200710", + "__INT_FAST32_MAX__=0x7fffffff", + "__DBL_HAS_INFINITY__=1", + "__INT64_MAX__=0x7fffffffffffffffLL", + "__ACCUM_IBIT__=16", + "__DEC32_MIN_EXP__=(-94)", + "__THUMB_INTERWORK__=1", + "__INTPTR_WIDTH__=32", + "__LACCUM_MAX__=0X7FFFFFFFFFFFFFFFP-31LK", + "__FLT32X_HAS_DENORM__=1", + "__INT_FAST16_TYPE__=int", + "__LDBL_HAS_DENORM__=1", + "__cplusplus=201402L", + "__cpp_ref_qualifiers=200710", + "__DEC128_MAX__=9.999999999999999999999999999999999E6144DL", + "__INT_LEAST32_MAX__=0x7fffffffL", + "__ARM_PCS=1", + "__DEC32_MIN__=1E-95DF", + "__ACCUM_MAX__=0X7FFFFFFFP-15K", + "__DEPRECATED=1", + "__cpp_rvalue_references=200610", + "__DBL_MAX_EXP__=1024", + "__USACCUM_EPSILON__=0x1P-8UHK", + "__WCHAR_WIDTH__=32", + "__FLT32_MAX__=3.4028234663852886e+38F32", + "__DEC128_EPSILON__=1E-33DL", + "__SFRACT_MAX__=0X7FP-7HR", + "__FRACT_IBIT__=0", + "__PTRDIFF_MAX__=0x7fffffff", + "__UACCUM_MIN__=0.0UK", + "__UACCUM_IBIT__=16", + "__FLT32_HAS_QUIET_NAN__=1", + "__GNUG__=7", + "__LONG_LONG_MAX__=0x7fffffffffffffffLL", + "__SIZEOF_SIZE_T__=4", + "__ULACCUM_MAX__=0XFFFFFFFFFFFFFFFFP-32ULK", + "__cpp_rvalue_reference=200610", + "__cpp_nsdmi=200809", + "__SIZEOF_WINT_T__=4", + "__LONG_LONG_WIDTH__=64", + "__cpp_initializer_lists=200806", + "__FLT32_MAX_EXP__=128", + "__SA_IBIT__=16", + "__ULLACCUM_MIN__=0.0ULLK", + "__cpp_hex_float=201603", + "__GXX_ABI_VERSION=1011", + "__UTA_FBIT__=64", + "__SOFTFP__=1", + "__FLT_MIN_EXP__=(-125)", + "__USFRACT_MAX__=0XFFP-8UHR", + "__UFRACT_IBIT__=0", + "__cpp_lambdas=200907", + "__INT_FAST64_TYPE__=long long int", + "__FLT64_DENORM_MIN__=4.9406564584124654e-324F64", + "__DBL_MIN__=double(2.2250738585072014e-308L)", + "__FLT32X_EPSILON__=2.2204460492503131e-16F32x", + "__LACCUM_MIN__=(-0X1P31LK-0X1P31LK)", + "__ULLACCUM_FBIT__=32", + "__GXX_TYPEINFO_EQUALITY_INLINE=0", + "__FLT64_MIN_10_EXP__=(-307)", + "__ULLFRACT_EPSILON__=0x1P-64ULLR", + "__USES_INITFINI__=1", + "__DEC128_MIN__=1E-6143DL", + "__REGISTER_PREFIX__", + "__UINT16_MAX__=0xffff", + "__DBL_HAS_DENORM__=1", + "__ACCUM_MIN__=(-0X1P15K-0X1P15K)", + "__SQ_IBIT__=0", + "__FLT32_MIN__=1.1754943508222875e-38F32", + "__UINT8_TYPE__=unsigned char", + "__UHA_FBIT__=8", + "__NO_INLINE__=1", + "__SFRACT_MIN__=(-0.5HR-0.5HR)", + "__UTQ_FBIT__=128", + "__FLT_MANT_DIG__=24", + "__LDBL_DECIMAL_DIG__=17", + "__VERSION__=\"7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204]\"", + "__UINT64_C(c)=c ## ULL", + "__ULLFRACT_FBIT__=64", + "__cpp_unicode_characters=200704", + "__FRACT_EPSILON__=0x1P-15R", + "__ULACCUM_MIN__=0.0ULK", + "__UDA_FBIT__=32", + "__cpp_decltype_auto=201304", + "__LLACCUM_EPSILON__=0x1P-31LLK", + "__GCC_ATOMIC_INT_LOCK_FREE=1", + "__FLT32_MANT_DIG__=24", + "__FLOAT_WORD_ORDER__=__ORDER_LITTLE_ENDIAN__", + "__USFRACT_MIN__=0.0UHR", + "__ULLACCUM_IBIT__=32", + "__UQQ_IBIT__=0", + "__SCHAR_WIDTH__=8", + "__INT32_C(c)=c ## L", + "__DEC64_EPSILON__=1E-15DD", + "__ORDER_PDP_ENDIAN__=3412", + "__DEC128_MIN_EXP__=(-6142)", + "__UHQ_FBIT__=16", + "__LLACCUM_FBIT__=31", + "__FLT32_MAX_10_EXP__=38", + "__INT_FAST32_TYPE__=int", + "__UINT_LEAST16_TYPE__=short unsigned int", + "__INT16_MAX__=0x7fff", + "__cpp_rtti=199711", + "__SIZE_TYPE__=unsigned int", + "__UINT64_MAX__=0xffffffffffffffffULL", + "__UDQ_FBIT__=64", + "__INT8_TYPE__=signed char", + "__cpp_digit_separators=201309", + "__ELF__=1", + "__ULFRACT_EPSILON__=0x1P-32ULR", + "__LLFRACT_FBIT__=63", + "__FLT_RADIX__=2", + "__INT_LEAST16_TYPE__=short int", + "__LDBL_EPSILON__=2.2204460492503131e-16L", + "__UINTMAX_C(c)=c ## ULL", + "__SACCUM_MAX__=0X7FFFP-7HK", + "__SIG_ATOMIC_MAX__=0x7fffffff", + "__GCC_ATOMIC_WCHAR_T_LOCK_FREE=1", + "__cpp_sized_deallocation=201309", + "__VFP_FP__=1", + "__SIZEOF_PTRDIFF_T__=4", + "__FLT32X_MANT_DIG__=53", + "__LACCUM_EPSILON__=0x1P-31LK", + "__FLT32X_MIN_EXP__=(-1021)", + "__DEC32_SUBNORMAL_MIN__=0.000001E-95DF", + "__INT_FAST16_MAX__=0x7fffffff", + "__FLT64_DIG__=15", + "__UINT_FAST32_MAX__=0xffffffffU", + "__UINT_LEAST64_TYPE__=long long unsigned int", + "__USACCUM_MAX__=0XFFFFP-8UHK", + "__SFRACT_EPSILON__=0x1P-7HR", + "__FLT_HAS_QUIET_NAN__=1", + "__FLT_MAX_10_EXP__=38", + "__LONG_MAX__=0x7fffffffL", + "__DEC128_SUBNORMAL_MIN__=0.000000000000000000000000000000001E-6143DL", + "__FLT_HAS_INFINITY__=1", + "__cpp_unicode_literals=200710", + "__USA_FBIT__=16", + "__UINT_FAST16_TYPE__=unsigned int", + "__DEC64_MAX__=9.999999999999999E384DD", + "__ARM_32BIT_STATE=1", + "__INT_FAST32_WIDTH__=32", + "__CHAR16_TYPE__=short unsigned int", + "__PRAGMA_REDEFINE_EXTNAME=1", + "__SIZE_WIDTH__=32", + "__INT_LEAST16_MAX__=0x7fff", + "__DEC64_MANT_DIG__=16", + "__UINT_LEAST32_MAX__=0xffffffffUL", + "__SACCUM_FBIT__=7", + "__FLT32_DENORM_MIN__=1.4012984643248171e-45F32", + "__GCC_ATOMIC_LONG_LOCK_FREE=1", + "__SIG_ATOMIC_WIDTH__=32", + "__INT_LEAST64_TYPE__=long long int", + "__INT16_TYPE__=short int", + "__INT_LEAST8_TYPE__=signed char", + "__SQ_FBIT__=31", + "__DEC32_MAX_EXP__=97", + "__ARM_ARCH_ISA_THUMB=1", + "__INT_FAST8_MAX__=0x7fffffff", + "__ARM_ARCH=4", + "__INTPTR_MAX__=0x7fffffff", + "__QQ_FBIT__=7", + "__cpp_range_based_for=200907", + "__UTA_IBIT__=64", + "__FLT64_HAS_QUIET_NAN__=1", + "__FLT32_MIN_10_EXP__=(-37)", + "__EXCEPTIONS=1", + "__LDBL_MANT_DIG__=53", + "__SFRACT_FBIT__=7", + "__SACCUM_MIN__=(-0X1P7HK-0X1P7HK)", + "__DBL_HAS_QUIET_NAN__=1", + "__FLT64_HAS_INFINITY__=1", + "__SIG_ATOMIC_MIN__=(-__SIG_ATOMIC_MAX__ - 1)", + "__cpp_return_type_deduction=201304", + "__INTPTR_TYPE__=int", + "__UINT16_TYPE__=short unsigned int", + "__WCHAR_TYPE__=unsigned int", + "__SIZEOF_FLOAT__=4", + "__USQ_FBIT__=32", + "__UINTPTR_MAX__=0xffffffffU", + "__INT_FAST64_WIDTH__=64", + "__DEC64_MIN_EXP__=(-382)", + "__cpp_decltype=200707", + "__FLT32_DECIMAL_DIG__=9", + "__INT_FAST64_MAX__=0x7fffffffffffffffLL", + "__GCC_ATOMIC_TEST_AND_SET_TRUEVAL=1", + "__FLT_DIG__=6", + "__UINT_FAST64_TYPE__=long long unsigned int", + "__INT_MAX__=0x7fffffff", + "__LACCUM_FBIT__=31", + "__USACCUM_MIN__=0.0UHK", + "__UHA_IBIT__=8", + "__INT64_TYPE__=long long int", + "__FLT_MAX_EXP__=128", + "__UTQ_IBIT__=0", + "__DBL_MANT_DIG__=53", + "__cpp_inheriting_constructors=201511", + "__INT_LEAST64_MAX__=0x7fffffffffffffffLL", + "__DEC64_MIN__=1E-383DD", + "__WINT_TYPE__=unsigned int", + "__UINT_LEAST32_TYPE__=long unsigned int", + "__SIZEOF_SHORT__=2", + "__ULLFRACT_IBIT__=0", + "__LDBL_MIN_EXP__=(-1021)", + "__arm__=1", + "__FLT64_MAX__=1.7976931348623157e+308F64", + "__UDA_IBIT__=32", + "__WINT_WIDTH__=32", + "__INT_LEAST8_MAX__=0x7f", + "__FLT32X_MAX_10_EXP__=308", + "__LFRACT_FBIT__=31", + "__WCHAR_UNSIGNED__=1", + "__LDBL_MAX_10_EXP__=308", + "__ATOMIC_RELAXED=0", + "__DBL_EPSILON__=double(2.2204460492503131e-16L)", + "__UINT8_C(c)=c", + "__FLT64_MAX_EXP__=1024", + "__INT_LEAST32_TYPE__=long int", + "__SIZEOF_WCHAR_T__=4", + "__LLFRACT_MAX__=0X7FFFFFFFFFFFFFFFP-63LLR", + "__TQ_FBIT__=127", + "__INT_FAST8_TYPE__=int", + "__ULLACCUM_EPSILON__=0x1P-32ULLK", + "__UHQ_IBIT__=0", + "__ARM_FEATURE_COPROC=1", + "__LLACCUM_IBIT__=32", + "__FLT64_HAS_DENORM__=1", + "__FLT32_EPSILON__=1.1920928955078125e-7F32", + "__DBL_DECIMAL_DIG__=17", + "__STDC_UTF_32__=1", + "__INT_FAST8_WIDTH__=32", + "__DEC_EVAL_METHOD__=2", + "__FLT32X_MAX__=1.7976931348623157e+308F32x", + "__TA_FBIT__=63", + "__UDQ_IBIT__=0", + "__ORDER_BIG_ENDIAN__=4321", + "__cpp_runtime_arrays=198712", + "__UINT64_TYPE__=long long unsigned int", + "__ACCUM_EPSILON__=0x1P-15K", + "__UINT32_C(c)=c ## UL", + "__INTMAX_MAX__=0x7fffffffffffffffLL", + "__cpp_alias_templates=200704", + "__BYTE_ORDER__=__ORDER_LITTLE_ENDIAN__", + "__FLT_DENORM_MIN__=1.4012984643248171e-45F", + "__LLFRACT_IBIT__=0", + "__INT8_MAX__=0x7f", + "__LONG_WIDTH__=32", + "__UINT_FAST32_TYPE__=unsigned int", + "__CHAR32_TYPE__=long unsigned int", + "__FLT_MAX__=3.4028234663852886e+38F", + "__cpp_constexpr=201304", + "__USACCUM_FBIT__=8", + "__INT32_TYPE__=long int", + "__SIZEOF_DOUBLE__=8", + "__cpp_exceptions=199711", + "__FLT_MIN_10_EXP__=(-37)", + "__UFRACT_EPSILON__=0x1P-16UR", + "__FLT64_MIN__=2.2250738585072014e-308F64", + "__INT_LEAST32_WIDTH__=32", + "__INTMAX_TYPE__=long long int", + "__DEC128_MAX_EXP__=6145", + "__FLT32X_HAS_QUIET_NAN__=1", + "__ATOMIC_CONSUME=1", + "__GNUC_MINOR__=2", + "__INT_FAST16_WIDTH__=32", + "__UINTMAX_MAX__=0xffffffffffffffffULL", + "__DEC32_MANT_DIG__=7", + "__FLT32X_DENORM_MIN__=4.9406564584124654e-324F32x", + "__HA_FBIT__=7", + "__DBL_MAX_10_EXP__=308", + "__LDBL_DENORM_MIN__=4.9406564584124654e-324L", + "__INT16_C(c)=c", + "__cpp_generic_lambdas=201304", + "__STDC__=1", + "__ARM_ARCH_4T__=1", + "__FLT32X_DIG__=15", + "__PTRDIFF_TYPE__=int", + "__LLFRACT_MIN__=(-0.5LLR-0.5LLR)", + "__ATOMIC_SEQ_CST=5", + "__DA_FBIT__=31", + "__UINT32_TYPE__=long unsigned int", + "__FLT32X_MIN_10_EXP__=(-307)", + "__UINTPTR_TYPE__=unsigned int", + "__USA_IBIT__=16", + "__DEC64_SUBNORMAL_MIN__=0.000000000000001E-383DD", + "__ARM_EABI__=1", + "__DEC128_MANT_DIG__=34", + "__LDBL_MIN_10_EXP__=(-307)", + "__SIZEOF_LONG_LONG__=8", + "__ULACCUM_EPSILON__=0x1P-32ULK", + "__cpp_user_defined_literals=200809", + "__SACCUM_IBIT__=8", + "__GCC_ATOMIC_LLONG_LOCK_FREE=1", + "__FLT32X_MIN__=2.2250738585072014e-308F32x", + "__LDBL_DIG__=15", + "__FLT_DECIMAL_DIG__=9", + "__UINT_FAST16_MAX__=0xffffffffU", + "__GCC_ATOMIC_SHORT_LOCK_FREE=1", + "__INT_LEAST64_WIDTH__=64", + "__ULLFRACT_MAX__=0XFFFFFFFFFFFFFFFFP-64ULLR", + "__UINT_FAST8_TYPE__=unsigned int", + "__USFRACT_EPSILON__=0x1P-8UHR", + "__ULACCUM_FBIT__=32", + "__QQ_IBIT__=0", + "__cpp_init_captures=201304", + "__ATOMIC_ACQ_REL=4", + "__ATOMIC_RELEASE=3", + "USBCON" + ] + } + ] +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..e86253b --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,29 @@ +{ + "configurations": [ + { + "name": "(gdb) Launch", + "type": "cppdbg", + "request": "launch", + "program": "enter program name, for example ${workspaceFolder}/a.out", + "args": [], + "stopAtEntry": false, + "cwd": "${fileDirname}", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "Set Disassembly Flavor to Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ] + } + ], + "version": "2.0.0" +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e2c18d1 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "ostream": "cpp" + } +} \ No newline at end of file diff --git a/arduino-quick-upload b/arduino-quick-upload index 589572d..663ebbe 100755 --- a/arduino-quick-upload +++ b/arduino-quick-upload @@ -2,7 +2,6 @@ source "arduino-ports-enable" - # Check if a command-line argument is provided and if the path exists if [ "$#" -eq 1 ] && [ -d "$1" ]; then project_path="$1" @@ -29,17 +28,18 @@ if [ "$num_arduinos" -eq 0 ]; then elif [ "$num_arduinos" -eq 1 ]; then # If only one Arduino is connected, use it arduino_port=$(echo "$board_list" | grep -oE '/dev/ttyACM[0-9]+') - board_type=$(echo "$board_list"| grep "$arduino_port" | awk '{print $(NF-1)}') + clones_port=$(echo "$board_list" | grep -oE '/dev/ttyUSB[0-9]+') + board_type=$(echo "$board_list" | grep "$arduino_port" | awk '{print $(NF-1)}') else # If multiple Arduinos are connected, ask the user to select one echo "Multiple Arduino boards found:" echo "$board_list" | tail -n +2 | awk '{print $1, $NF}' read -p "Please enter the port of the Arduino you want to upload to: " arduino_port - board_type=$(echo "$board_list" | grep "$arduino_port" | awk '{print $(NF-1)}' -) + board_type=$( + echo "$board_list" | grep "$arduino_port" | awk '{print $(NF-1)}' + ) fi # Compile and upload the project to the selected Arduino arduino-cli compile -b "$board_type" "$project_path" arduino-cli upload ./ -p "$arduino_port" -b "$board_type" - diff --git a/sender_module/DEV_Config.cpp b/sender_module/DEV_Config.cpp index 156c64b..4a8c787 100644 --- a/sender_module/DEV_Config.cpp +++ b/sender_module/DEV_Config.cpp @@ -30,6 +30,7 @@ # ******************************************************************************/ #include "DEV_Config.h" +#include SoftwareSerial mySerial(0, 1); // RX, TX /****************************************************************************** diff --git a/sender_module/DEV_Config.h b/sender_module/DEV_Config.h index ce8372e..46ebf07 100644 --- a/sender_module/DEV_Config.h +++ b/sender_module/DEV_Config.h @@ -1,7 +1,6 @@ #ifndef _DEV_CONFIG_H_ #define _DEV_CONFIG_H_ -#include #include #include #include diff --git a/sender_module/sender_module.ino b/sender_module/sender_module.ino index 89ccf34..d8034ee 100644 --- a/sender_module/sender_module.ino +++ b/sender_module/sender_module.ino @@ -1,22 +1,21 @@ -#include #include #include #include #include -#include +//#include #include "DEV_Config.h" -#include "L76X.h" -#include "Waveshare_10Dof-D.h" +//#include "L76X.h" +//#include "Waveshare_10Dof-D.h" // Define pin numbers for modules const int NRF_CE_PIN = 9; const int NRF_CS_PIN = 8; const byte address[6] = "00001"; -const int GPS_TX_PIN = 0; -const int GPS_RX_PIN = 1; +//const int GPS_TX_PIN = 0; +//const int GPS_RX_PIN = 1; //const String INA219_SDA_PIN = "A4"; //const String INA219_SCL_PIN = "A5"; @@ -27,7 +26,7 @@ const int LAUNCH_STAGE_PIN = 6; // Create objects for modules RF24 radio(NRF_CE_PIN, NRF_CS_PIN); -GNRMC GPS1; +//GNRMC GPS1; //Adafruit_INA219 ina219; File dataFile; @@ -88,7 +87,7 @@ void ready_stage() { counter = 0; } else { counter += 1; - delay(300) + delay(300); } if (counter == 10) { @@ -118,24 +117,24 @@ void arm_stage() { } // GPS - DEV_Set_Baudrate(9600); - DEV_Delay_ms(500); + //DEV_Set_Baudrate(9600); + //DEV_Delay_ms(500); // IMU - IMU_EN_SENSOR_TYPE enMotionSensorType, enPressureType; - imuInit(&enMotionSensorType, &enPressureType); - if (IMU_EN_SENSOR_TYPE_ICM20948 == enMotionSensorType) { - Serial.println("# Success ICM-20948 init"); - Serial.println(IMU_EN_SENSOR_TYPE_ICM20948); - } else { - Serial.println("# Fail ICM-20948 init"); - } - if (IMU_EN_SENSOR_TYPE_BMP280 == enPressureType) { - Serial.println("# Success BMP280 init"); - } else { - Serial.println("# Fail BMP280 init"); - Serial.println(enPressureType); - } + //IMU_EN_SENSOR_TYPE enMotionSensorType, enPressureType; + //imuInit(&enMotionSensorType, &enPressureType); + //if (IMU_EN_SENSOR_TYPE_ICM20948 == enMotionSensorType) { + // Serial.println("# Success ICM-20948 init"); + // Serial.println(IMU_EN_SENSOR_TYPE_ICM20948); + //} else { + // Serial.println("# Fail ICM-20948 init"); + //} + //if (IMU_EN_SENSOR_TYPE_BMP280 == enPressureType) { + // Serial.println("# Success BMP280 init"); + //} else { + // Serial.println("# Fail BMP280 init"); + // Serial.println(enPressureType); + //} // INA219 // if (!ina219.begin()) { @@ -184,7 +183,7 @@ void arm_stage() { counter = 0; } else { counter += 1; - delay(300) + delay(300); } if (counter == 10) { @@ -217,20 +216,20 @@ void landed_stage() { // Turn off gyro and accelerometer } -float getBatteryLevel() { - // Read bus voltage from INA219 - float busVoltage = ina219.getBusVoltage_V(); - - // Assuming fully charged battery voltage is 4.2V and empty is 3.0V - float maxVoltage = 4.2; - float minVoltage = 3.0; - - // Map the bus voltage to a battery level percentage - float batteryLevel = map(busVoltage, minVoltage, maxVoltage, 0, 100); - - // Constrain the battery level to be within 0 and 100 - batteryLevel = constrain(batteryLevel, 0, 100); - - return batteryLevel; -} +//float getBatteryLevel() { +// // Read bus voltage from INA219 +// float busVoltage = ina219.getBusVoltage_V(); +// +// // Assuming fully charged battery voltage is 4.2V and empty is 3.0V +// float maxVoltage = 4.2; +// float minVoltage = 3.0; +// +// // Map the bus voltage to a battery level percentage +// float batteryLevel = map(busVoltage, minVoltage, maxVoltage, 0, 100); +// +// // Constrain the battery level to be within 0 and 100 +// batteryLevel = constrain(batteryLevel, 0, 100); +// +// return batteryLevel; +//} diff --git a/sender_module_final/ISSUES.md b/sender_module_final/ISSUES.md new file mode 100644 index 0000000..66a0347 --- /dev/null +++ b/sender_module_final/ISSUES.md @@ -0,0 +1,4 @@ +# Problems + +- Arduino Nano Couldn't power up the sd card reader, need to input 5V to micro SD card reader. +- Couldn't make Arduino Nano work with nRF24 - maybe same issue diff --git a/sender_module_final/README.md b/sender_module_final/README.md new file mode 100644 index 0000000..9163132 --- /dev/null +++ b/sender_module_final/README.md @@ -0,0 +1,27 @@ +# Sender module + +## Stages of flight + +1. Preflight - Remove before flight button or smthing like that + - no communication, blocked parachute ejection, all systems down +2. Ready - Signal from groundstation + - sys check (modules calibration, battery check, atd...), blocked parachute ejection, wait for launch pin removed, only send data, do not save them +3. Launch - Removed pin from the rocket + - launch, all systems sending and saving data on sd card +4. Apogee - Detected that rocket is in apogee with accelerometer + - parachute ejection, all systems working, gps check and height check +5. Return - Rocket has no velocity + - all not needed systems shutdown/sleep, buzz on, gps sending location, battery check, turn off gyro and accelerometer + +## Modules + +- nRF24L01 - Communication with groundstation +- SD card reader - Write all recieved data to the SD card +- Buzzer - To find our rocket after launch +- Servo motors - Ejection of parachute + +## Tasks + +- PCB for our computer +- send signal of listening +- wait for recieve diff --git a/sender_module_final/sender_module_final.ino b/sender_module_final/sender_module_final.ino index 6518cf2..3545a8e 100644 --- a/sender_module_final/sender_module_final.ino +++ b/sender_module_final/sender_module_final.ino @@ -6,15 +6,14 @@ #include // Define pin numbers for modules -const int NRF_CE_PIN = 9; -const int NRF_CS_PIN = 8; const byte address[6] = "00001"; const int BUZZER_PIN = 2; const int SERVO_A_PIN = 3; +const int CHIP_SELECT = 4; const int SERVO_B_PIN = 5; - -int plusThreshold = 40, minusThreshold = -40; +const int NRF_CS_PIN = 8; +const int NRF_CE_PIN = 9; // Create objects for modules RF24 radio(NRF_CE_PIN, NRF_CS_PIN); @@ -77,7 +76,6 @@ void loop() } } -bool isButtonPressed(int buttonPin) { return digitalRead(buttonPin) == LOW; } void beep() { digitalWrite(BUZZER_PIN, HIGH); @@ -88,6 +86,7 @@ void beep() void ready_stage() { Serial.println("# READY stage"); + analogWrite(LED_BUILTIN, HIGH); beep(); if (!IMU.begin()) @@ -105,38 +104,44 @@ void ready_stage() // radio.write(&msg, sizeof(msg)); // Serial.println("# Success nRF24L01 init"); - //// SD card - // if (!SD.begin(4)) + // SD card + //if (!SD.begin(CHIP_SELECT)) //{ - // Serial.println("# Fail SD module init"); - // } - // else + // Serial.println("# Fail SD module init"); + //} + //else //{ - // Serial.println("# Success SD module init"); - // } - // if (SD.exists("data.txt")) + // Serial.println("# Success SD module init"); + //} +// + //if (SD.exists("data.txt")) //{ - // Serial.println("# File exists"); - // } - // else + // Serial.println("# File exists"); + //} + //else //{ - // Serial.println("# File does not exist"); - // dataFile = SD.open("data.txt", FILE_WRITE); - // } - // if (dataFile) + // Serial.println("# File does not exist"); + // dataFile = SD.open("data.txt", FILE_WRITE); + //} +// + //if (dataFile) //{ - // Serial.println("# File opened"); - // dataFile.println("# CobraV2 flight data"); - // } - // else + // Serial.println("# File opened"); + // dataFile.println("# CobraV2 flight data"); + //} + //else //{ - // Serial.println("# Error opening file"); - // } + // Serial.println("# Error opening file"); + //} Serial.print("# Accelerometer sample rate = "); Serial.print(IMU.accelerationSampleRate()); Serial.println(" Hz"); + //dataFile.print("# Accelerometer sample rate = "); + //dataFile.println(IMU.accelerationSampleRate()); + //dataFile.close(); + current_stage = ARM; } @@ -154,12 +159,22 @@ void arm_stage() int counter = 0; float x, y, z; + bool toggle = false; + //dataFile = SD.open("data.txt", FILE_WRITE); + //dataFile.println("# ARM stage"); while (true) { if (IMU.accelerationAvailable()) { IMU.readAcceleration(x, y, z); Serial.println(x); + + //dataFile.print(x); + //dataFile.print(" "); + //dataFile.print(y); + //dataFile.print(" "); + //dataFile.println(z); + if (x > 1) { Serial.println("# Launch Detect"); @@ -171,14 +186,26 @@ void arm_stage() } } - if (counter > 10) + if (counter < 15) { Serial.println("# Launching"); + //dataFile.println("# Launching"); break; } + + if (toggle) + { + digitalWrite(LED_BUILTIN, HIGH); + } + else + { + digitalWrite(LED_BUILTIN, LOW); + } + toggle = !toggle; } current_stage = ASCENT; + //dataFile.close(); } void ascent_stage() @@ -186,91 +213,51 @@ void ascent_stage() Serial.println("# ASCENT Stage"); unsigned long StartTime = millis(); int FailOrientationCounter = 0; + //File dataFile = SD.open("data.txt", FILE_WRITE); + //dataFile.println("# ASCENT stage"); while (true) { unsigned long CurrentTime = millis(); unsigned long ElapsedTime = CurrentTime - StartTime; Serial.println(ElapsedTime); - float x, y, z; - - if (IMU.accelerationAvailable()) + if (IMU.gyroscopeAvailable()) { - IMU.readAcceleration(x, y, z); + float x, y, z; + IMU.readGyroscope(x, y, z); } - int degreesX = 0; - int degreesY = 0; - - if (x > 0.1) - { - x = 100 * x; - degreesX = map(x, 0, 97, 0, 90); - Serial.print("# Tilting up "); - Serial.print(degreesX); - Serial.println(" degrees"); - } - - if (x < -0.1) - { - x = 100 * x; - degreesX = map(x, 0, -100, 0, 90); - Serial.print("# Tilting down "); - Serial.print(degreesX); - Serial.println(" degrees"); - } - - if (y > 0.1) - { - y = 100 * y; - degreesY = map(y, 0, 97, 0, 90); - Serial.print("Tilting left "); - Serial.print(degreesY); - Serial.println(" degrees"); - } - - if (y < -0.1) - { - y = 100 * y; - degreesY = map(y, 0, -100, 0, 90); - Serial.print("# Tilting right "); - Serial.print(degreesY); - Serial.println(" degrees"); - } - - if (((y < -0.1 || y > 0.1) && degreesY > 40) || (x < -0.1 && degreesX < 50) || (x > 0.1)) - { - FailOrientationCounter++; - } - else - { - FailOrientationCounter = 0; - } - - if ((ElapsedTime > 9000) || (FailOrientationCounter > 20)) + if ((ElapsedTime > 9000)) { + dataFile.println("# Apogee detected by time"); break; } } current_stage = DESCENT; + //dataFile.close(); } void descent_stage() { Serial.println("# DESCENT stage"); + //File dataFile = SD.open("data.txt", FILE_WRITE); + //dataFile.println("# DESCENT stage"); for (int pos = 0; pos <= 150; pos += 1) { // in steps of 1 degree A.write(pos); delay(1); + Serial.println(pos); } for (int pos = 90; pos >= 0; pos -= 1) { B.write(pos); delay(1); + Serial.println(pos); } + Serial.println("# Parachute deployed"); unsigned long StartTime = millis(); while (true) @@ -280,10 +267,12 @@ void descent_stage() if (ElapsedTime > 300000) { + //dataFile.println("# Landing detected"); break; } } current_stage = LANDED; + //dataFile.close(); } void landed_stage() diff --git a/testing/serial_communication_test/serial_communication_test.ino b/testing/serial_communication_test/serial_communication_test.ino new file mode 100644 index 0000000..e69de29