Class for reading a MAX6665 SPI thermocouple interface.
More...
#include <MAX6675_RK.h>
|
|
| MAX6675_RK () |
| | Construct an object using primary SPI (SPI) and default CS pin (SS)
|
| |
| | MAX6675_RK (pin_t csPin) |
| | Construct an object using primary SPI (SPI) and the specified CS pin.
|
| |
| | MAX6675_RK (SPIClass *spi, pin_t csPin) |
| | Construct an object using the specified SPI interface and the specified CS pin.
|
| |
| MAX6675_RK & | withSPI (SPIClass *spi) |
| | Set the SPI interface if not setting it from the constructor.
|
| |
| MAX6675_RK & | withCS (pin_t csPin) |
| | Set the CS pin it not setting it from the constructor.
|
| |
| MAX6675_RK & | withOpenDetection (bool value) |
| | Sets whether open detection mode is enabled or not (default is true)
|
| |
| void | setup () |
| | Perform setup operations; call this from global application setup()
|
| |
| uint16_t | readRaw () |
| | Read the raw 16-bit value from the sensor.
|
| |
| float | readValue () |
| | Return a value in degrees Celsius.
|
| |
| float | readValueF () |
| | Return a value in degrees Fahrenheit.
|
| |
|
| static float | convertCtoF (float value) |
| | Convert a value from degrees C to degrees F.
|
| |
|
|
SPIClass * | spi = &SPI |
| | SPI interface to use.
|
| |
|
pin_t | csPin = SS |
| | Pin to use for CS.
|
| |
|
bool | openDetection = true |
| | Whether to detect open or missinbg sensor.
|
| |
|
SPISettings | spiSettings = SPISettings(4 * MHZ, MSBFIRST, SPI_MODE3) |
| | SPI settings, You won't generally have to change these settings; they're based on what the MAX6675 requires.
|
| |
Class for reading a MAX6665 SPI thermocouple interface.
◆ MAX6675_RK() [1/2]
| MAX6675_RK::MAX6675_RK |
( |
pin_t | csPin | ) |
|
|
inline |
Construct an object using primary SPI (SPI) and the specified CS pin.
- Parameters
-
◆ MAX6675_RK() [2/2]
| MAX6675_RK::MAX6675_RK |
( |
SPIClass * | spi, |
|
|
pin_t | csPin ) |
|
inline |
Construct an object using the specified SPI interface and the specified CS pin.
- Parameters
-
| spi | A SPI interface such as &SPI or &SPI1. |
| csPin | A pin, such as D2. |
◆ convertCtoF()
| static float MAX6675_RK::convertCtoF |
( |
float | value | ) |
|
|
inlinestatic |
Convert a value from degrees C to degrees F.
- Parameters
-
- Returns
- float
◆ readRaw()
| uint16_t MAX6675_RK::readRaw |
( |
| ) |
|
Read the raw 16-bit value from the sensor.
- Returns
- uint16_t
◆ readValue()
| float MAX6675_RK::readValue |
( |
| ) |
|
Return a value in degrees Celsius.
- Returns
- float A value in degrees C. It will be in the range 0 <= value <= 1023.75.
Returns NaN if the sensor (T+ or T-) is not connected. See withOpenDetection().
Will typically return 0.0 if the chip is not connected via SPI.
◆ readValueF()
| float MAX6675_RK::readValueF |
( |
| ) |
|
|
inline |
Return a value in degrees Fahrenheit.
- Returns
- float A value in degrees F. It will be in the range of 32.0 <= value <= 1874.75.
Returns NaN if the sensor (T+ or T-) is not connected. See withOpenDetection().
Will typically return 32.0 if the chip is not connected via SPI.
◆ setup()
| void MAX6675_RK::setup |
( |
| ) |
|
Perform setup operations; call this from global application setup()
This must be done after with withXXX() methods. It basically calls spi->begin() with the specified csPin. This sets the pinMode of the SPI pins and csPin, and also sets the csPin to HIGH.
◆ withCS()
Set the CS pin it not setting it from the constructor.
- Parameters
-
- Returns
- MAX6675_RK&
Must be called before setup().
◆ withOpenDetection()
| MAX6675_RK & MAX6675_RK::withOpenDetection |
( |
bool | value | ) |
|
|
inline |
Sets whether open detection mode is enabled or not (default is true)
- Parameters
-
| value | true is enable open detection, false to disable |
- Returns
- MAX6675_RK&
The MAX6675 can detect sensor open (or missing), but only if T- and GND are connected. This feature is enabled by default because the suggested design connects the two. If for some reason you've isolated T- and GND, then be sure to use withOpenDetection(false).
◆ withSPI()
| MAX6675_RK & MAX6675_RK::withSPI |
( |
SPIClass * | spi | ) |
|
|
inline |
Set the SPI interface if not setting it from the constructor.
- Parameters
-
| spi | A SPI interface such as &SPI or &SPI1. |
- Returns
- MAX6675_RK&
Must be called before setup().
The documentation for this class was generated from the following files: