29 #include <mraa/gpio.h>
33 #define NUMBER_OF_SAMPLES 500
34 #define ADC_RESOLUTION 1024
35 #define SUPPLYVOLTAGE 5100
36 #define CURRENT_RATIO 2000.0
71 static const uint8_t DELAY_MS = 20000 / NUMBER_OF_SAMPLES;
72 static const uint8_t VOLT_M = 5.1 / 1023;
73 static const uint8_t R_LOAD = 2000.0 / CURRENT_RATIO;
115 mraa_aio_context m_dataPinCtx;
117 double m_calibration;
121 double m_filteredSample;
~ECS1030()
Definition: ecs1030.cxx:49
double getPower_B()
Definition: ecs1030.cxx:99
double getCurrency_A()
Definition: ecs1030.cxx:58
double getCurrency_B()
Definition: ecs1030.cxx:78
std::string name()
Definition: ecs1030.h:110
ECS1030(uint8_t pinNumber)
Definition: ecs1030.cxx:40
C++ API for the ECS1030 Non-Invasive Current/Electricity Sensor.
Definition: ecs1030.h:69
double getPower_A()
Definition: ecs1030.cxx:94