From e7e678cbee00ead479145dbc88170f376fec4b53 Mon Sep 17 00:00:00 2001 From: Greg Sandstrom Date: Wed, 31 Jan 2024 11:43:10 -0800 Subject: [PATCH] switch from platformio to arduino vscode extension by ms, starting testing some scripts for RT clock --- .vscode/arduino.json | 6 + .vscode/c_cpp_properties.json | 527 ++++++++++++++++++++++++++++++ blink/blink.ino | 41 +++ dirwin-nano-every/.gitignore | 5 - dirwin-nano-every/.vscode/extensions.json | 10 - dirwin-nano-every/include/README | 39 --- dirwin-nano-every/lib/README | 46 --- dirwin-nano-every/platformio.ini | 17 - dirwin-nano-every/src/main.cpp | 18 - dirwin-nano-every/test/README | 11 - dirwin.ino | 125 +++++++ set_pfc8523/set_pfc8523.ino | 36 ++ 12 files changed, 735 insertions(+), 146 deletions(-) create mode 100644 .vscode/arduino.json create mode 100644 .vscode/c_cpp_properties.json create mode 100644 blink/blink.ino delete mode 100644 dirwin-nano-every/.gitignore delete mode 100644 dirwin-nano-every/.vscode/extensions.json delete mode 100644 dirwin-nano-every/include/README delete mode 100644 dirwin-nano-every/lib/README delete mode 100644 dirwin-nano-every/platformio.ini delete mode 100644 dirwin-nano-every/src/main.cpp delete mode 100644 dirwin-nano-every/test/README create mode 100644 dirwin.ino create mode 100644 set_pfc8523/set_pfc8523.ino diff --git a/.vscode/arduino.json b/.vscode/arduino.json new file mode 100644 index 0000000..fec287e --- /dev/null +++ b/.vscode/arduino.json @@ -0,0 +1,6 @@ +{ + "configuration": "opt=small,usbstack=arduino,debug=off", + "board": "adafruit:samd:adafruit_feather_m0", + "port": "/dev/tty.usbmodem1401", + "sketch": "dirwin.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..7a6ff17 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,527 @@ +{ + "version": 4, + "configurations": [ + { + "name": "Arduino", + "compilerPath": "/Users/greg/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/arm-none-eabi-g++", + "compilerArgs": [ + "-mcpu=cortex-m0plus", + "-mthumb", + "-Werror=return-type", + "-std=gnu++11", + "-ffunction-sections", + "-fdata-sections", + "-fno-threadsafe-statics", + "-nostdlib", + "--param", + "-fno-rtti", + "-fno-exceptions" + ], + "intelliSenseMode": "gcc-x64", + "includePath": [ + "/Users/greg/Library/Arduino15/packages/adafruit/hardware/samd/1.7.12/libraries/Adafruit_TinyUSB_Arduino/src/arduino", + "/Users/greg/Library/Arduino15/packages/adafruit/hardware/samd/1.7.12/libraries/Adafruit_TinyUSB_Arduino/src/arduino", + "/Users/greg/Library/Arduino15/packages/adafruit/tools/CMSIS/5.4.0/CMSIS/Core/Include/", + "/Users/greg/Library/Arduino15/packages/adafruit/tools/CMSIS/5.4.0/CMSIS/DSP/Include/", + "/Users/greg/Library/Arduino15/packages/adafruit/tools/CMSIS-Atmel/1.2.2/CMSIS/Device/ATMEL/", + "/Users/greg/Library/Arduino15/packages/adafruit/hardware/samd/1.7.12/cores/arduino", + "/Users/greg/Library/Arduino15/packages/adafruit/hardware/samd/1.7.12/variants/feather_m0", + "/Users/greg/Documents/Arduino/libraries/RTClib/src", + "/Users/greg/Documents/Arduino/libraries/Adafruit_BusIO", + "/Users/greg/Library/Arduino15/packages/adafruit/hardware/samd/1.7.12/libraries/Wire", + "/Users/greg/Library/Arduino15/packages/adafruit/hardware/samd/1.7.12/libraries/SPI", + "/Users/greg/Library/Arduino15/packages/adafruit/hardware/samd/1.7.12/libraries/Adafruit_ZeroDMA", + "/Users/greg/Documents/Arduino/libraries/SD/src", + "/Users/greg/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/arm-none-eabi/include/c++/9.2.1", + "/Users/greg/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/arm-none-eabi/include/c++/9.2.1/arm-none-eabi", + "/Users/greg/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/arm-none-eabi/include/c++/9.2.1/backward", + "/Users/greg/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/lib/gcc/arm-none-eabi/9.2.1/include", + "/Users/greg/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/lib/gcc/arm-none-eabi/9.2.1/include-fixed", + "/Users/greg/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/arm-none-eabi/include" + ], + "forcedInclude": [ + "/Users/greg/Library/Arduino15/packages/adafruit/hardware/samd/1.7.12/cores/arduino/Arduino.h" + ], + "cStandard": "c11", + "cppStandard": "c++11", + "defines": [ + "__SKETCH_NAME__=\"\"\"dirwin.ino\"\"\"", + "F_CPU=48000000L", + "ARDUINO=10607", + "ARDUINO_SAMD_ZERO", + "ARDUINO_ARCH_SAMD", + "ARDUINO_SAMD_ADAFRUIT", + "__SAMD21G18A__", + "ADAFRUIT_FEATHER_M0", + "ARDUINO_SAMD_ZERO", + "ARM_MATH_CM0PLUS", + "USB_VID=0x239A", + "USB_PID=0x800B", + "USBCON", + "USB_CONFIG_POWER=100", + "USB_MANUFACTURER=\"Adafruit\"", + "USB_PRODUCT=\"Feather M0\"", + "__SAMD21G18A__", + "ADAFRUIT_FEATHER_M0", + "ARDUINO_SAMD_ZERO", + "ARM_MATH_CM0PLUS", + "USB_VID=0x239A", + "USB_PID=0x800B", + "USBCON", + "USB_CONFIG_POWER=100", + "USB_MANUFACTURER=\"Adafruit\"", + "USB_PRODUCT=\"Feather M0\"", + "__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", + "__cpp_rvalue_reference=200610", + "__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", + "__cpp_threadsafe_static_init=200806", + "__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__=9", + "__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", + "__HAVE_SPECULATION_SAFE_VALUE=1", + "__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__=9", + "__LONG_LONG_MAX__=0x7fffffffffffffffLL", + "__SIZEOF_SIZE_T__=4", + "__ULACCUM_MAX__=0XFFFFFFFFFFFFFFFFP-32ULK", + "__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=1013", + "__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", + "__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__=\"9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]\"", + "__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", + "__DBL_HAS_DENORM__=1", + "__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", + "__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", + "__INT64_MAX__=0x7fffffffffffffffLL", + "__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", + "__cpp_sized_deallocation=201309", + "__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/blink/blink.ino b/blink/blink.ino new file mode 100644 index 0000000..80f94c4 --- /dev/null +++ b/blink/blink.ino @@ -0,0 +1,41 @@ +/* + Blink + + Turns an LED on for one second, then off for one second, repeatedly. + + Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO + it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to + the correct LED pin independent of which board is used. + If you want to know what pin the on-board LED is connected to on your Arduino + model, check the Technical Specs of your board at: + https://www.arduino.cc/en/Main/Products + + modified 8 May 2014 + by Scott Fitzgerald + modified 2 Sep 2016 + by Arturo Guadalupi + modified 8 Sep 2016 + by Colby Newman + + This example code is in the public domain. + + https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink +*/ + +int LED_PIN = 8; + +// the setup function runs once when you press reset or power the board +void setup() +{ + // initialize digital pin LED_BUILTIN as an output. + pinMode(LED_PIN, OUTPUT); +} + +// the loop function runs over and over again forever +void loop() +{ + digitalWrite(LED_PIN, HIGH); // turn the LED on (HIGH is the voltage level) + delay(1000); // wait for a second + digitalWrite(LED_PIN, LOW); // turn the LED off by making the voltage LOW + delay(500); // wait for a second +} diff --git a/dirwin-nano-every/.gitignore b/dirwin-nano-every/.gitignore deleted file mode 100644 index 89cc49c..0000000 --- a/dirwin-nano-every/.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/dirwin-nano-every/.vscode/extensions.json b/dirwin-nano-every/.vscode/extensions.json deleted file mode 100644 index 080e70d..0000000 --- a/dirwin-nano-every/.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/dirwin-nano-every/include/README b/dirwin-nano-every/include/README deleted file mode 100644 index 194dcd4..0000000 --- a/dirwin-nano-every/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/dirwin-nano-every/lib/README b/dirwin-nano-every/lib/README deleted file mode 100644 index 6debab1..0000000 --- a/dirwin-nano-every/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 diff --git a/dirwin-nano-every/platformio.ini b/dirwin-nano-every/platformio.ini deleted file mode 100644 index bbc302a..0000000 --- a/dirwin-nano-every/platformio.ini +++ /dev/null @@ -1,17 +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:nano_every] -platform = atmelmegaavr -board = nano_every -framework = arduino -lib_deps = - arduino-libraries/SD@^1.2.4 - adafruit/RTClib@^2.1.3 diff --git a/dirwin-nano-every/src/main.cpp b/dirwin-nano-every/src/main.cpp deleted file mode 100644 index cb9fbba..0000000 --- a/dirwin-nano-every/src/main.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include - -// put function declarations here: -int myFunction(int, int); - -void setup() { - // put your setup code here, to run once: - int result = myFunction(2, 3); -} - -void loop() { - // put your main code here, to run repeatedly: -} - -// put function definitions here: -int myFunction(int x, int y) { - return x + y; -} \ No newline at end of file diff --git a/dirwin-nano-every/test/README b/dirwin-nano-every/test/README deleted file mode 100644 index 9b1e87b..0000000 --- a/dirwin-nano-every/test/README +++ /dev/null @@ -1,11 +0,0 @@ - -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 diff --git a/dirwin.ino b/dirwin.ino new file mode 100644 index 0000000..f3000d0 --- /dev/null +++ b/dirwin.ino @@ -0,0 +1,125 @@ +#include +#include +#include +#include + +#define SDCARD_CS_PIN 4 +// valves are normally closed +#define ONSHORE_PIN PIN_A0 +#define OFFSHORE_PIN PIN_A1 +// how frequently to update +#define DECISION_PERIOD_MS 30000 + +RTC_PCF8523 rtc; +char entry_buffer[512]; +File logfile; +DateTime now; +volatile float wind_direction; +volatile float wind_velocity; + +enum decision +{ + ONSHORE = 0, + OFFSHORE = 1, + UNCERTAIN = 2 +}; + +void setup() +{ + /* + * Real Time Clock + */ + rtc.begin(); + if (!rtc.initialized() || rtc.lostPower()) + { + Serial.println("RTC is not initialized or lost power, setting time..."); + // When time needs to be set on a new device, or after a power loss, the + // following line sets the RTC to the date & time this sketch was compiled + DateTime set_time = DateTime(F(__DATE__), F(__TIME__)); + rtc.adjust(set_time); + Serial.write(sprintf("RTC datetime set to %s", set_time.toString("MMM-DD-YYYY hh:mm:ss"))); + } + else + { + now = rtc.now(); + Serial.write(sprintf("RTC time: %s", now.toString("MMM-DD-YYYY hh:mm:ss"))); + } + + // make sure stop bit is cleared and rtc is running + rtc.start(); + + /* + * MicroSD card + */ + // setup sd card pins + SD.begin(SDCARD_CS_PIN); + // figure out filename using newly set datetime + DateTime now = rtc.now(); + char filename_string[255]; + sprintf(filename_string, "%s.txt", now.toString("YYYY-MM-DD")); + // open logfile + logfile = SD.open(filename_string); + + /* + * Met Station + */ + // setup met station serial + + /* + * Digital valve control pins + */ + pinMode(ONSHORE_PIN, OUTPUT); + pinMode(OFFSHORE_PIN, OUTPUT); +} + +void loop() +{ + // grab reading + + // grab time + now = rtc.now(); + + // decide on sampler settings + decision d = decide(wind_direction, wind_velocity); + + // assemble log entry and write to SD card + // csv format + // DATETIME,WIND_DIRECTION,WIND_VELOCITY,DECISION + sprintf(entry_buffer, "%s,%f.2,%f.2,%i\n", now.toString("YYYY-MM-DD hh:mm:ss"), wind_direction, wind_velocity, d); + logfile.write(entry_buffer); + logfile.flush(); + + // delay until next decision time + delay(DECISION_PERIOD_MS); +} + +decision decide(float direction, float velocity) +{ + return UNCERTAIN; +} + +void sample_onshore() +{ + // open sampling to onshore valve + digitalWrite(ONSHORE_PIN, HIGH); + // wait a moment + delay(500); + // close sampling for offshore valve + digitalWrite(OFFSHORE_PIN, LOW); +} + +void sample_offshore() +{ + // open sampling to offshore valve + digitalWrite(OFFSHORE_PIN, HIGH); + // wait a moment + delay(500); + // close sampling for onshore valve + digitalWrite(ONSHORE_PIN, LOW); +} + +void sample_both() +{ + digitalWrite(ONSHORE, HIGH); + digitalWrite(OFFSHORE, HIGH); +} \ No newline at end of file diff --git a/set_pfc8523/set_pfc8523.ino b/set_pfc8523/set_pfc8523.ino new file mode 100644 index 0000000..41518f6 --- /dev/null +++ b/set_pfc8523/set_pfc8523.ino @@ -0,0 +1,36 @@ +#include + +// https://github.com/adafruit/RTClib/blob/master/examples/pcf8523/pcf8523.ino + +RTC_PCF8523 rtc; + +void setup() +{ + Serial.begin(9600); + + rtc.begin(); + if (!rtc.initialized() || rtc.lostPower()) + { + Serial.println("RTC is not initialized or lost power, setting time..."); + // When time needs to be set on a new device, or after a power loss, the + // following line sets the RTC to the date & time this sketch was compiled + DateTime set_time = DateTime(F(__DATE__), F(__TIME__)); + rtc.adjust(set_time); + Serial.write(sprintf("RTC datetime set to %s", set_time.toString("MMM-DD-YYYY hh:mm:ss"))); + } + else + { + DateTime now = rtc.now(); + Serial.write(sprintf("RTC time: %s", now.toString("MMM-DD-YYYY hh:mm:ss"))); + } + + // make sure stop bit is cleared and rtc is running + rtc.start(); +} + +void loop() +{ + DateTime now = rtc.now(); + Serial.write(sprintf("RTC time: %s", now.toString("MMM-DD-YYYY hh:mm:ss"))); + delay(5000); +} \ No newline at end of file -- 1.9.1