![]() |
McMajan Library Pack
v 2.00
Improve your Arduino !
|
#include <Ss_Energia.h>
Public Member Functions | |
Energia () | |
void | Start (int mp=-1) |
Inizialize Energia. More... | |
void | ReadMiddlePoint (uint16_t) |
Read middle point: this function uses Kalman filter to reduce the noise. More... | |
void | ReadPowerData (struct Mc_AnalogSensor *, struct Mc_AnalogSensor *, uint8_t wavenumber=1) |
Read voltage and current data from sensors. This function calculates apparent power, real power, rms current and voltage. More... | |
void | GetWaveValue (struct Mc_AnalogSensor *, uint8_t wavenumber=1) |
Sample waves. More... | |
void | SetRipple (float, uint16_t num=450) |
Set ripple noise. More... | |
float | RippleRemover (float) |
Remove ripple value from specified value. More... | |
Public Attributes | |
int | Pin_MiddlePoint |
float | midpoint |
float | ripple |
uint16_t | counter |
float | rmsI |
float | rmsV |
float | rmsS |
float | rP |
float | aP |
float | minI |
float | maxI |
float | minV |
float | maxV |
float | minS |
float | maxS |
Definition at line 8 of file Ss_Energia.h.
Energia | ( | ) |
Definition at line 75 of file Ss_Energia.cpp.
void GetWaveValue | ( | struct Mc_AnalogSensor * | S, |
uint8_t | wavenumber = 1 |
||
) |
Sample waves.
S | is the sensor connected to source |
wavenumber | is the number of waves you want to sample. If not specified it's setted to 1 |
Definition at line 135 of file Ss_Energia.cpp.
References Mc_SampleAnalogAvg(), midpoint, Mc_AnalogSensor::pin, and Mc_AnalogSensor::sensor_step.
void ReadMiddlePoint | ( | uint16_t | campioni | ) |
Read middle point: this function uses Kalman filter to reduce the noise.
campioni | is the number of samples |
Definition at line 123 of file Ss_Energia.cpp.
void ReadPowerData | ( | struct Mc_AnalogSensor * | V, |
struct Mc_AnalogSensor * | I, | ||
uint8_t | wavenumber = 1 |
||
) |
Read voltage and current data from sensors. This function calculates apparent power, real power, rms current and voltage.
V | is the pointer to voltage sensor. If NULL, Energia uses default voltage (see Ss_Global.h) |
I | is the pointer to current sensor |
wavenumber | number of scanned waves |
Definition at line 8 of file Ss_Energia.cpp.
References aP, maxI, maxV, Mc_SampleAnalogAvg(), midpoint, minI, minV, Mc_AnalogSensor::pin, rmsI, rmsV, and Mc_AnalogSensor::sensor_step.
float RippleRemover | ( | float | value | ) |
Remove ripple value from specified value.
value | is the value you want to clean from ripple |
Definition at line 113 of file Ss_Energia.cpp.
void SetRipple | ( | float | rip, |
uint16_t | num = 450 |
||
) |
Set ripple noise.
mp | is the analogic pin to read middle point. If not specified Energia uses perfect half scale as middle point. |
num | specify the number of samples. If not specificated is set to 450. |
Definition at line 95 of file Ss_Energia.cpp.
References ripple.
void Start | ( | int | mp = -1 | ) |
Inizialize Energia.
mp | is the analogic pin to read middle point. If not specificated Energia uses perfect half scale as middle point. |
Definition at line 84 of file Ss_Energia.cpp.
References Mc_Analog_Inist(), and Pin_MiddlePoint.
float aP |
Apparent Power
Definition at line 27 of file Ss_Energia.h.
uint16_t counter |
count samples
Definition at line 21 of file Ss_Energia.h.
float maxI |
maximum current misured
Definition at line 29 of file Ss_Energia.h.
float maxS |
maximum sensor misured
Definition at line 33 of file Ss_Energia.h.
float maxV |
maximum voltage misured
Definition at line 31 of file Ss_Energia.h.
float midpoint |
Definition at line 19 of file Ss_Energia.h.
float minI |
minimum current misured
Definition at line 28 of file Ss_Energia.h.
float minS |
minimum sensor misured
Definition at line 32 of file Ss_Energia.h.
float minV |
minimum voltage misured
Definition at line 30 of file Ss_Energia.h.
int Pin_MiddlePoint |
Definition at line 12 of file Ss_Energia.h.
float ripple |
Definition at line 20 of file Ss_Energia.h.
float rmsI |
current RMS value
Definition at line 23 of file Ss_Energia.h.
float rmsS |
sensor RMS value: this is not a specific value
Definition at line 25 of file Ss_Energia.h.
float rmsV |
voltage RMS value
Definition at line 24 of file Ss_Energia.h.
float rP |
Real Power
Definition at line 26 of file Ss_Energia.h.