Hi I use this code
#include "EmonLib.h" // Include Emon Library
#include "JeeLib.h"
EnergyMonitor ct1; // Create an instance
void setup()
{
//rf12_set_cs(8);
Serial.begin(9600);
ct1.currentTX(1, 111.1); // CT channel, calibration
}
void loop()
{
double Irms = ct1.calcIrms(1480); // Calculate RMS current (1480: no. of samples)
Serial.print(Irms*240.0); // Print to serial apparent power
Serial.print(" ");
Serial.println(Irms); // Print to serial Irms
}
But I receive values look like true when I connect on CT3. But in the code normaly I used CT1. It run on leonardo, not yet with ethernetshield.
Any ideas?
Thx
Re: seems o work on CT3 and not CT1
The library EmonLib.cpp contains the conversion from channel to pin number, which is correct only for the emonTx hardware:
If you are using different I/O pins, it will not work. You must use the same I/O pins, or change your library.
Re: seems o work on CT3 and not CT1
Thanks for your answer, I find on EmonLib.cpp the conversion. So correct me if I am wrong. Like it s show on Port Map, I use CT1 ADC1. With this information, I have to change cpp like this if (_channel ==1) inPinI=1;
Correct?
Max
Port Map
Re: seems o work on CT3 and not CT1
If you have connected CT1 to ADC1, then yes. Only you know how you have wired it ;-)