Open Garden  0.10.1-21
Macros | Functions
temperature.h File Reference

temperature handling functions. More...

#include "ogstruct.h"
#include "tcn75.h"
#include "debug.h"
Include dependency graph for temperature.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define T_MEAN_INIT   15
 
#define T_RT_INIT   -99
 
#define DFACTOR_INIT   0
 
#define T_MEAN_WS   0.001
 
#define T_MEAN_WA   0.999
 
#define T_MEAN_RATIO_FULLSUN   5.0
 ratio full sun More...
 
#define T_MEAN_RATIO_HALFSUN   6.0
 ratio half sun
 
#define T_MEAN_RATIO_SHADOW   5.0
 ratio shadow
 
#define T_MEAN_BASE_FULLSUN   24.0
 temperature at which time is considered ok
 
#define T_MEAN_BASE_HALFSUN   20.0
 
#define T_MEAN_BASE_SHADOW   15.0
 

Functions

void temperature_update (struct programs_t *progs)
 update the temperature and the arithmetic mean.
 
void temperature_print (struct programs_t *progs, struct debug_t *debug)
 
void temperature_init (void)
 

Detailed Description

temperature handling functions.

Macro Definition Documentation

◆ DFACTOR_INIT

#define DFACTOR_INIT   0

Delay factor initial value.

◆ T_MEAN_BASE_HALFSUN

#define T_MEAN_BASE_HALFSUN   20.0

Mean base hs

◆ T_MEAN_BASE_SHADOW

#define T_MEAN_BASE_SHADOW   15.0

Mean base sw

◆ T_MEAN_INIT

#define T_MEAN_INIT   15

Temperature arithmetic mean initial value.

◆ T_MEAN_RATIO_FULLSUN

#define T_MEAN_RATIO_FULLSUN   5.0

ratio full sun

The formula is: dfactor = (temperature mean - T_MEAN_BASE)/T_MEAN_RATIO + 1

Warning
keep it float (1.0 instead of 1)

◆ T_MEAN_WA

#define T_MEAN_WA   0.999

Temperature mean weight all.

weigth mean = 1.0 - weight single;

Warning
keep it float, do not put the operation like

◆ T_MEAN_WS

#define T_MEAN_WS   0.001

Weight of a single temperature value for the arithmetic mean.

Used in the rolling arithmetic mean to add a new value with its proper weight.

weight single = 1.0 / total_minutes;

Warning
keep it float (1.0 instead of 1)
Note
usign 24h as period (1440 minutes)

◆ T_RT_INIT

#define T_RT_INIT   -99

Safe realtime temperature initial value.

Function Documentation

◆ temperature_init()

void temperature_init ( void  )

initialize the temperature sensor.

◆ temperature_print()

void temperature_print ( struct programs_t progs,
struct debug_t debug 
)

print the temperature.