Initial thermocouple impl

This commit is contained in:
2026-03-27 23:23:14 +01:00
parent 3ea71788c2
commit 2c15ae43ae
4 changed files with 58 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
// Copyright (C) 2026 Hector van der Aa <hector@h3cx.dev>
// Copyright (C) 2026 Association Exergie <association.exergie@gmail.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#include "thermocouple.h"
int thermocouple::push(const Task &task) { return _queue.push(task); }
thermocouple::thermocouple() : _logger(nullptr) {}
thermocouple::thermocouple(system_logger *logger) : _logger(logger) {}
thermocouple::~thermocouple() {}
int thermocouple::init() {
_thermocouple = new MAX6675(THERMO_SCK, THERMO_CS, THERMO_SO);
return 0;
}
int thermocouple::loop(unsigned long timeout_ms) {
if (millis() > _last_read + _update_interval) {
_temp = _thermocouple->readCelsius();
}
}