3-phase PV router
|
Main code for the PVRouter 3-phase project. More...
#include <Arduino.h>
#include "config.h"
#include "calibration.h"
#include "processing.h"
#include "types.h"
#include "utils.h"
#include "utils_relay.h"
#include "validation.h"
#include "main.h"
Go to the source code of this file.
Functions | |
void | checkDiversionOnOff () |
Checks and updates the diversion state based on the diversion pin. | |
bool | forceFullPower () |
Forces all loads to full power if the override pin is active. | |
void | handlePerSecondTasks (bool &bOffPeak, int16_t &iTemperature_x100) |
Handles tasks that need to be executed every second. | |
void | loop () |
Main processor loop. | |
bool | proceedLoadPrioritiesAndOverriding (const int16_t ¤tTemperature_x100) |
Handles load priorities and overriding logic. | |
bool | proceedLoadPrioritiesAndOverridingDualTariff (const int16_t ¤tTemperature_x100) |
Handles load priorities and overriding during dual tariff periods. | |
void | proceedRotation () |
Proceeds with load priority rotation. | |
void | processTemperatureData () |
Processes temperature data from DS18B20 sensors. | |
void | setup () |
Called once during startup. | |
void | updatePowerAndVoltageData () |
Updates power and voltage data for all phases. | |
Main code for the PVRouter 3-phase project.
This file contains the main logic for the PVRouter, including the setup and loop functions, as well as interrupt service routines (ISRs) and utility functions for managing load priorities, temperature sensing, and telemetry data.
Definition in file main.cpp.
void processTemperatureData | ( | ) |
Processes temperature data from DS18B20 sensors.
This function reads temperature values from all connected DS18B20 sensors, filters out invalid readings, and updates the telemetry data structure with valid temperature values. Invalid readings are identified as 85.00°C (encoded as 8500) with a delta greater than 5.00°C (encoded as 500) from the previous reading. After processing, it requests new temperature measurements for the next cycle.
temperatureSensing
object must be initialized and configured with the connected DS18B20 sensors.tx_data.temperature_x100
array is updated with the latest valid temperature readings. Definition at line 370 of file main.cpp.