-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSensorManager.h
More file actions
39 lines (32 loc) · 977 Bytes
/
SensorManager.h
File metadata and controls
39 lines (32 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef SENSOR_MANAGER_H
#define SENSOR_MANAGER_H
#include <Arduino.h>
#include <Adafruit_MAX31865.h>
// Define HSPI Pins
#define MAX_CS 25
// #define MAX_DI 25
// #define MAX_DO 13
// #define MAX_CLK 16
// The value of the reference resistor on the board in ohms.
// Should be 430 (+- 1%) from factory. Measured ~423.8.
#define RREF 424.0
// The 'nominal' resistance of the sensor at 0C (100 for PT100)
#define RNOMINAL 100.0
class SensorManager {
private:
Adafruit_MAX31865* thermo; // Pointer to the library object
SPIClass* maxSPI; // Shared bus with SD
unsigned long lastReadTime;
float currentTemp;
bool isMeasuring;
unsigned long measureStartTime;
public:
SensorManager(SPIClass* sharedSPI);
void init();
void update();
float getTemp();
float getEstimatedGroupheadTemp(unsigned long timeSinceBoilerReadyMs);
// Helper to check if the sensor is actually connected
bool checkFaults();
};
#endif