Good day to all! I am a newbie in Arduino and I have a problem concerning how to convert the variables in the emonlib so that the it can be sent via SMS.
I thought of converting the variables (which, i think, are declared as double) to string or char type. I have searched the net for solutions, however, there where no fit answers.
To those who can help please do impart your opinions it will be highly appreciated. Attached below is the code of the program.
I thought of converting the variables (which, i think, are declared as double) to string or char type. I have searched the net for solutions, however, there where no fit answers.
You did not look very hard if you could not find how to convert a float or double to a string (dtostrf()) or an int to a string (itoa()).
If you think you are going to find an example that sends data from the EnergyMonitor instance as an SMS, you are dreaming.
this part is just for the serial monitor so that i can view the data being read.
I have tried using the dtostrf(). However, after i added the library, i tested compiling the original code without the dtostrf() command but there was an error. The error was not displayed in the message window area.
this part is just for the serial monitor so that i can view the data being read.
You did not post a link to the EnergyMonitor library, so the only way we have to know if realPower, apparentPower, etc. are floats or ints or something else is to see the output.
I have tried using the dtostrf(). However, after i added the library, i tested compiling the original code without the dtostrf() command but there was an error. The error was not displayed in the message window area.
Was it printed on a postcard and mailed to you? Sent via morse code by blinking the power light on the PC? Sent by letting the magic smoke out as smoke signals?