From 256d08178a9f00a13b7ad4bbb0bccc3ea1bafd36 Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Fri, 19 Jan 2024 18:32:44 +0100 Subject: [PATCH] 0.3.0 MAX6675 --- libraries/MAX6675/CHANGELOG.md | 5 +++++ libraries/MAX6675/LICENSE | 2 +- libraries/MAX6675/MAX6675.cpp | 8 ++++---- libraries/MAX6675/MAX6675.h | 4 ++-- libraries/MAX6675/README.md | 7 +++++++ .../MAX6675/examples/Demo_getRawData/Demo_getRawData.ino | 1 + libraries/MAX6675/examples/MAX6675_test/MAX6675_test.ino | 2 ++ .../examples/MAX6675_test_HWSPI/MAX6675_test_HWSPI.ino | 3 +++ .../MAX6675_test_plotter/MAX6675_test_plotter.ino | 3 +++ libraries/MAX6675/library.json | 2 +- libraries/MAX6675/library.properties | 2 +- 11 files changed, 30 insertions(+), 9 deletions(-) diff --git a/libraries/MAX6675/CHANGELOG.md b/libraries/MAX6675/CHANGELOG.md index c3e0e088..fb6577b9 100644 --- a/libraries/MAX6675/CHANGELOG.md +++ b/libraries/MAX6675/CHANGELOG.md @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.3.0] - 2024-01-19 +- Fix #9, improve handling SPI dependency. + +---- + ## [0.2.0] - 2023-11-28 - refactor constructor/begin interface - breaking changes. - minimize conditional code. -- create SPI_CLASS macro to solve it. diff --git a/libraries/MAX6675/LICENSE b/libraries/MAX6675/LICENSE index 7ff52579..3f2859b6 100644 --- a/libraries/MAX6675/LICENSE +++ b/libraries/MAX6675/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022-2023 Rob Tillaart +Copyright (c) 2022-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/MAX6675/MAX6675.cpp b/libraries/MAX6675/MAX6675.cpp index 709f73c9..a85bdd6e 100644 --- a/libraries/MAX6675/MAX6675.cpp +++ b/libraries/MAX6675/MAX6675.cpp @@ -1,7 +1,7 @@ // // FILE: MAX6675.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.2.0 +// VERSION: 0.3.0 // PURPOSE: Arduino library for MAX6675 chip for K type thermocouple // DATE: 2022-01-11 // URL: https://github.com/RobTillaart/MAX6675 @@ -47,9 +47,9 @@ void MAX6675::begin() if (_hwSPI) { - _mySPI->end(); - _mySPI->begin(); - delay(1); + // _mySPI->end(); + // _mySPI->begin(); + // delay(1); } else { diff --git a/libraries/MAX6675/MAX6675.h b/libraries/MAX6675/MAX6675.h index 030a03eb..1936d6f6 100644 --- a/libraries/MAX6675/MAX6675.h +++ b/libraries/MAX6675/MAX6675.h @@ -2,7 +2,7 @@ // // FILE: MAX6675.h // AUTHOR: Rob Tillaart -// VERSION: 0.2.0 +// VERSION: 0.3.0 // PURPOSE: Arduino library for MAX6675 chip for K type thermocouple // DATE: 2022-01-12 // URL: https://github.com/RobTillaart/MAX6675 @@ -23,7 +23,7 @@ #include "SPI.h" -#define MAX6675_LIB_VERSION (F("0.2.0")) +#define MAX6675_LIB_VERSION (F("0.3.0")) #ifndef __SPI_CLASS__ #if defined(ARDUINO_ARCH_RP2040) diff --git a/libraries/MAX6675/README.md b/libraries/MAX6675/README.md index 942a9e67..dc609303 100644 --- a/libraries/MAX6675/README.md +++ b/libraries/MAX6675/README.md @@ -34,6 +34,13 @@ Different TC's have a different Seebeck Coefficient (SC) expressed in µV/°C. See http://www.analog.com/library/analogDialogue/archives/44-10/thermocouple.html +#### 0.3.0 Breaking change + +Version 0.3.0 introduced a breaking change to improve handling the SPI dependency. +The user has to call **SPI.begin()** or equivalent before calling **AD.begin()**. +Optionally the user can provide parameters to the **SPI.begin(...)** + + #### Breakout The library is tested with a breakout board with following pins: diff --git a/libraries/MAX6675/examples/Demo_getRawData/Demo_getRawData.ino b/libraries/MAX6675/examples/Demo_getRawData/Demo_getRawData.ino index ca7791d5..53fa5706 100644 --- a/libraries/MAX6675/examples/Demo_getRawData/Demo_getRawData.ino +++ b/libraries/MAX6675/examples/Demo_getRawData/Demo_getRawData.ino @@ -25,6 +25,7 @@ void setup () Serial.println(); delay(250); + SPI.begin(); thermoCouple.begin(); } diff --git a/libraries/MAX6675/examples/MAX6675_test/MAX6675_test.ino b/libraries/MAX6675/examples/MAX6675_test/MAX6675_test.ino index 39680369..f6942242 100644 --- a/libraries/MAX6675/examples/MAX6675_test/MAX6675_test.ino +++ b/libraries/MAX6675/examples/MAX6675_test/MAX6675_test.ino @@ -28,6 +28,8 @@ void setup() Serial.println(); delay(250); + SPI.begin(); + thermoCouple.begin(); thermoCouple.setSPIspeed(4000000); } diff --git a/libraries/MAX6675/examples/MAX6675_test_HWSPI/MAX6675_test_HWSPI.ino b/libraries/MAX6675/examples/MAX6675_test_HWSPI/MAX6675_test_HWSPI.ino index 73c78509..a38543cb 100644 --- a/libraries/MAX6675/examples/MAX6675_test_HWSPI/MAX6675_test_HWSPI.ino +++ b/libraries/MAX6675/examples/MAX6675_test_HWSPI/MAX6675_test_HWSPI.ino @@ -8,6 +8,7 @@ #include "MAX6675.h" + const int selectPin = 5; MAX6675 thermoCouple(selectPin, &SPI); @@ -24,6 +25,8 @@ void setup() Serial.println(); delay(250); + SPI.begin(); + thermoCouple.begin(); } diff --git a/libraries/MAX6675/examples/MAX6675_test_plotter/MAX6675_test_plotter.ino b/libraries/MAX6675/examples/MAX6675_test_plotter/MAX6675_test_plotter.ino index ceec08ae..d2a1a74c 100644 --- a/libraries/MAX6675/examples/MAX6675_test_plotter/MAX6675_test_plotter.ino +++ b/libraries/MAX6675/examples/MAX6675_test_plotter/MAX6675_test_plotter.ino @@ -8,6 +8,7 @@ #include "MAX6675.h" + const int dataPin = 7; const int clockPin = 6; const int selectPin = 5; @@ -28,6 +29,8 @@ void setup() // Serial.println(); delay(250); + SPI.begin(); + thermoCouple.begin(); thermoCouple.setSPIspeed(4000000); diff --git a/libraries/MAX6675/library.json b/libraries/MAX6675/library.json index 12b260ab..389fd582 100644 --- a/libraries/MAX6675/library.json +++ b/libraries/MAX6675/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/MAX6675" }, - "version": "0.2.0", + "version": "0.3.0", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/libraries/MAX6675/library.properties b/libraries/MAX6675/library.properties index 6e9545d8..0830f8c8 100644 --- a/libraries/MAX6675/library.properties +++ b/libraries/MAX6675/library.properties @@ -1,5 +1,5 @@ name=MAX6675 -version=0.2.0 +version=0.3.0 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for MAX6675 chip for K type thermocouple.