update modules

This commit is contained in:
José Valdiviesso 2020-08-19 18:10:35 +01:00
parent 74eb332790
commit 68d43dd583
4 changed files with 22 additions and 9 deletions

3
.gitmodules vendored
View File

@ -4,3 +4,6 @@
[submodule "src/InfluxDB-Client-for-Arduino"]
path = src/InfluxDB-Client-for-Arduino
url = https://github.com/tobiasschuerg/InfluxDB-Client-for-Arduino.git
[submodule "scr/PZEM-004T-v30"]
path = scr/PZEM-004T-v30
url = https://github.com/mandulaj/PZEM-004T-v30.git

View File

@ -46,14 +46,24 @@ void setup() {
Serial.begin(115200);
ConnectToWiFiMulti();
ConnectToInflux();
analogReadResolution(ADC_BITS);
emon1.voltage(Vpin, 234.26, 1.7); // Voltage: input pin, calibration, phase_shift
emon1.current(Apin, 111.1); // Current: input pin, calibration.
analogReadResolution(12);
pinMode(Apin, INPUT);
Serial.println(ADC_COUNTS);
emon1.voltage(Vpin, 406, 1.7); // Voltage: input pin, calibration, phase_shift
emon1.current(Apin, 66); // Current: input pin, calibration.
}
void loop() {
Serial.println(analogRead(Vpin));
emon1.calcVI(20, 2000); // Calculate all. No.of half wavelengths (crossings), time-out
emon1.serialprint(); // Print out all variables (realpower, apparent power, Vrms, Irms, power factor)
Serial.print(emon1.Vrms);
Serial.print(" Volts | ");
Serial.print(emon1.Irms);
Serial.print(" Amps | ");
Serial.print(emon1.Vrms*emon1.Irms);
Serial.println(" Watts");
Serial.println(emon1.calcIrms(1480));
//emon1.serialprint(); // Print out all variables (realpower, apparent power, Vrms, Irms, power factor)
delay(5000);
//influx to be implemented...

1
scr/PZEM-004T-v30 Submodule

@ -0,0 +1 @@
Subproject commit d4590976d412fafa91df66f1592314aae790b642

@ -1 +0,0 @@
Subproject commit 02d21ad457d4bc42b386c9952e21e552d7847e41