From bb7fcdbe15b3895232d137f130030c29ded0e98d Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Fri, 5 Jan 2024 09:52:07 +0100 Subject: [PATCH] 0.1.4 MAX31850 --- libraries/MAX31850/CHANGELOG.md | 6 +- libraries/MAX31850/LICENSE | 2 +- libraries/MAX31850/MAX31850.cpp | 5 +- libraries/MAX31850/MAX31850.h | 7 +- libraries/MAX31850/README.md | 2 +- .../MAX31850_getAddress.ino | 3 +- .../MAX31850_minimum/MAX31850_minimum.ino | 5 +- .../MAX31850_test_disconnect.ino | 1 + .../MAX31850_two_sensors.ino | 3 +- .../examples/oneWireSearch/oneWireSearch.ino | 97 +++++++++++++++++++ libraries/MAX31850/library.json | 2 +- libraries/MAX31850/library.properties | 2 +- 12 files changed, 121 insertions(+), 14 deletions(-) create mode 100644 libraries/MAX31850/examples/oneWireSearch/oneWireSearch.ino diff --git a/libraries/MAX31850/CHANGELOG.md b/libraries/MAX31850/CHANGELOG.md index b76b2862..1980a1ae 100644 --- a/libraries/MAX31850/CHANGELOG.md +++ b/libraries/MAX31850/CHANGELOG.md @@ -6,10 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.1.4] - 2024-01-04 +- Add URL to examples +- minor edits + + ## [0.1.3] - 2023-11-11 - update readme.md - ## [0.1.2] - 2023-01-23 - update GitHub actions - update license 2023 diff --git a/libraries/MAX31850/LICENSE b/libraries/MAX31850/LICENSE index 088bbaf1..3afaaeda 100644 --- a/libraries/MAX31850/LICENSE +++ b/libraries/MAX31850/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021-2023 Rob Tillaart +Copyright (c) 2021-2024 Rob Tillaart Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/libraries/MAX31850/MAX31850.cpp b/libraries/MAX31850/MAX31850.cpp index ec4e219a..bc6bda56 100644 --- a/libraries/MAX31850/MAX31850.cpp +++ b/libraries/MAX31850/MAX31850.cpp @@ -1,9 +1,10 @@ // // FILE: MAX31850.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.1.3 +// VERSION: 0.1.4 // DATE: 2021-06-03 -// PUPROSE: Arduino library for the MAX31850 thermocouple temperature sensor. +// PURPOSE: Arduino library for the MAX31850 thermocouple temperature sensor. +// URL: https://github.com/RobTillaart/MAX31850 #include "MAX31850.h" diff --git a/libraries/MAX31850/MAX31850.h b/libraries/MAX31850/MAX31850.h index d59c1366..11cee64f 100644 --- a/libraries/MAX31850/MAX31850.h +++ b/libraries/MAX31850/MAX31850.h @@ -2,12 +2,13 @@ // // FILE: MAX31850.h // AUTHOR: Rob Tillaart -// VERSION: 0.1.3 +// VERSION: 0.1.4 // DATE: 2021-06-03 -// PUPROSE: Arduino library for the MAX31850 thermocouple temperature sensor. +// PURPOSE: Arduino library for the MAX31850 thermocouple temperature sensor. +// URL: https://github.com/RobTillaart/MAX31850 -#define MAX31850_LIB_VERSION (F("0.1.3")) +#define MAX31850_LIB_VERSION (F("0.1.4")) #include "Arduino.h" #include "OneWire.h" diff --git a/libraries/MAX31850/README.md b/libraries/MAX31850/README.md index c4bac5bd..32ee5da0 100644 --- a/libraries/MAX31850/README.md +++ b/libraries/MAX31850/README.md @@ -161,7 +161,7 @@ The MAX31850 comes in MAX31850E.. MAX31850T types reflecting the version of TC t - investigate different thermocouples - test with different platforms -- has the 31851 special features to implement? +- has the MAX31851 special features to implement? #### could diff --git a/libraries/MAX31850/examples/MAX31850_getAddress/MAX31850_getAddress.ino b/libraries/MAX31850/examples/MAX31850_getAddress/MAX31850_getAddress.ino index 797c7a20..48cde2a9 100644 --- a/libraries/MAX31850/examples/MAX31850_getAddress/MAX31850_getAddress.ino +++ b/libraries/MAX31850/examples/MAX31850_getAddress/MAX31850_getAddress.ino @@ -2,13 +2,14 @@ // FILE: MAX31850_getAddress.ino // AUTHOR: Rob Tillaart // PURPOSE: MAX31850 lib getAddress demo +// URL: https://github.com/RobTillaart/MAX31850 #include "OneWire.h" #include "MAX31850.h" -#define ONE_WIRE_BUS 2 +#define ONE_WIRE_BUS 2 OneWire oneWire(ONE_WIRE_BUS); diff --git a/libraries/MAX31850/examples/MAX31850_minimum/MAX31850_minimum.ino b/libraries/MAX31850/examples/MAX31850_minimum/MAX31850_minimum.ino index 71b0bc11..0f5697ab 100644 --- a/libraries/MAX31850/examples/MAX31850_minimum/MAX31850_minimum.ino +++ b/libraries/MAX31850/examples/MAX31850_minimum/MAX31850_minimum.ino @@ -2,13 +2,14 @@ // FILE: MAX31850_minimum.ino // AUTHOR: Rob Tillaart // PURPOSE: minimal sketch +// URL: https://github.com/RobTillaart/MAX31850 #include "OneWire.h" #include "MAX31850.h" -#define ONE_WIRE_BUS 2 +#define ONE_WIRE_BUS 2 OneWire oneWire(ONE_WIRE_BUS); @@ -43,5 +44,5 @@ void loop(void) } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/libraries/MAX31850/examples/MAX31850_test_disconnect/MAX31850_test_disconnect.ino b/libraries/MAX31850/examples/MAX31850_test_disconnect/MAX31850_test_disconnect.ino index c32bf420..366d993c 100644 --- a/libraries/MAX31850/examples/MAX31850_test_disconnect/MAX31850_test_disconnect.ino +++ b/libraries/MAX31850/examples/MAX31850_test_disconnect/MAX31850_test_disconnect.ino @@ -2,6 +2,7 @@ // FILE: MAX31850_test_disconnect.ino // AUTHOR: Rob Tillaart // PURPOSE: Minimal MAX31850 lib with async support. +// URL: https://github.com/RobTillaart/MAX31850 #include "OneWire.h" diff --git a/libraries/MAX31850/examples/MAX31850_two_sensors/MAX31850_two_sensors.ino b/libraries/MAX31850/examples/MAX31850_two_sensors/MAX31850_two_sensors.ino index c721d9e3..be8acdec 100644 --- a/libraries/MAX31850/examples/MAX31850_two_sensors/MAX31850_two_sensors.ino +++ b/libraries/MAX31850/examples/MAX31850_two_sensors/MAX31850_two_sensors.ino @@ -2,13 +2,14 @@ // FILE: MAX31850_two_sensors.ino // AUTHOR: Rob Tillaart // PURPOSE: demo with two sensors (on two pins) +// URL: https://github.com/RobTillaart/MAX31850 #include "OneWire.h" #include "MAX31850.h" -#define ONE_WIRE_BUS 2 +#define ONE_WIRE_BUS 2 OneWire oneWire(ONE_WIRE_BUS); diff --git a/libraries/MAX31850/examples/oneWireSearch/oneWireSearch.ino b/libraries/MAX31850/examples/oneWireSearch/oneWireSearch.ino new file mode 100644 index 00000000..79bad654 --- /dev/null +++ b/libraries/MAX31850/examples/oneWireSearch/oneWireSearch.ino @@ -0,0 +1,97 @@ +// +// FILE: oneWireSearch.ino +// AUTHOR: Rob Tillaart +// VERSION: 0.1.5 +// PURPOSE: scan for 1-Wire devices + code snippet generator +// DATE: 2015-june-30 +// URL: https://github.com/RobTillaart/DS18B20_RT +// URL: https://github.com/RobTillaart/DS2401 +// URL: http://forum.arduino.cc/index.php?topic=333923 +// +// inspired by http://www.hacktronics.com/Tutorials/arduino-1-wire-address-finder.html +// + + +// HISTORY +// 0.1.00 initial version +// 0.1.01 first published version +// 0.1.02 small output changes +// 0.1.03 added more explicit range +// 0.1.04 added CRC check +// 0.1.5 fix do while loop (thanks pzygielo) + + +// UNO has pin 2..20 +// MEGA and others have different range + +const int startPin = 2; +const int endPin = 20; + + +#include "OneWire.h" + + +uint8_t findDevices(int pin) +{ + OneWire ow(pin); + + uint8_t address[8]; + uint8_t count = 0; + + if (ow.search(address)) + { + Serial.print("\nuint8_t pin"); + Serial.print(pin, DEC); + Serial.println("[][8] = {"); + do + { + count++; + Serial.println(" {"); + for (uint8_t i = 0; i < 8; i++) + { + Serial.print("0x"); + if (address[i] < 0x10) Serial.print("0"); + Serial.print(address[i], HEX); + if (i < 7) Serial.print(", "); + } + Serial.print(" },"); + // CHECK CRC + if (ow.crc8(address, 7) == address[7]) + { + Serial.println("\t\t// CRC OK"); + } + else + { + Serial.println("\t\t// CRC FAILED"); + } + } while (ow.search(address)); + + Serial.println("};"); + Serial.print("// nr devices found: "); + Serial.println(count); + } + + return count; +} + + +void setup() +{ + Serial.begin(115200); + Serial.println("//\n// Start oneWireSearch.ino \n//"); + + for (uint8_t pin = startPin; pin < endPin; pin++) + { + findDevices(pin); + } + Serial.println("\n//\n// End oneWireSearch.ino \n//"); +} + + +void loop() +{ +} + + +// -- END OF FILE -- + diff --git a/libraries/MAX31850/library.json b/libraries/MAX31850/library.json index 17f28cd7..bf43c7ad 100644 --- a/libraries/MAX31850/library.json +++ b/libraries/MAX31850/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/MAX31850.git" }, - "version": "0.1.3", + "version": "0.1.4", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/libraries/MAX31850/library.properties b/libraries/MAX31850/library.properties index 17ce59ff..688541d5 100644 --- a/libraries/MAX31850/library.properties +++ b/libraries/MAX31850/library.properties @@ -1,5 +1,5 @@ name=MAX31850 -version=0.1.3 +version=0.1.4 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for the MAX31850 thermocouple temperature sensor.