need language support : emon library public variables - RESOLVED

need language support : emon library  variables

there are public and private variables  in EmonLib.h,

can i use a public variable like Vrms in main loop?  ( use example voltage_and_current )

Serial.print(Vrms); does not compile!

kllsamui's picture

Re: need language support : emon library public variables - RESOLVED

SOLVED:

  Serial.println(emon1.Vrms); // works

Robert Wall's picture

Re: need language support : emon library public variables - RESOLVED

That is because Vrms is a property of the class "EnergyMonitor", which you have instantiated as "emon1".

If you had several instances of the class EnergyMonitor, as you do in the sketch EmonTx_CT123_Voltage.ino:

EnergyMonitor ct1,ct2,ct3; 

Then you would use

Serial.println(ct1.Vrms);
Serial.println(ct2.Vrms);
Serial.println(ct3.Vrms);

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.