mounted up another low power emontx and set time between readings to 300000 so it should have an interval of 5 mins...
but the maximum i have seen is 45 secs
is there some max limit?
code atached
Archived Forum |
|
can't get emontx to report temp at 5 min intervalSubmitted by boelle on Fri, 19/07/2013 - 18:00mounted up another low power emontx and set time between readings to 300000 so it should have an interval of 5 mins...
but the maximum i have seen is 45 secs is there some max limit? code atached » |
Re: can't get emontx to report temp at 5 min interval
const int time_between_readings= 300000;
Why don't you look up the documentation on what int means, then check the documentation on the delay function that uses that value?
Re: can't get emontx to report temp at 5 min interval
the sample sket says it should be in ms and i just thought it would be the time between readings in ms
Re: can't get emontx to report temp at 5 min interval
read the sample sketch again and as i understand it
const int time_between_readings
is used to tell it how long it should sleep on this line
Sleepy::loseSomeTime(time_between_readings);
Re: can't get emontx to report temp at 5 min interval
Forget what you are trying to do, your problem is with your very basic understanding of programming. Look up the documentation on what int means, as in "int time_between_readings" What is an "int" in the Arduino?
Re: can't get emontx to report temp at 5 min interval
so i tried with a long instead of int.. same result
Re: can't get emontx to report temp at 5 min interval
Have you looked at the documentation for Sleepy::loseSomeTime( ) ?
Re: can't get emontx to report temp at 5 min interval
a few mods to my code was all there is to it
const long time_between_readings= 60000;
and
for (byte i = 0; i < 5; ++i)Edited by mod - Paulfor (byte i = 0; i < 5; i++)
Sleepy::loseSomeTime(time_between_readings);
change 5 to whatever you want in minutes between readings
the main thing with losesometime is that it only works up to 60 sec in 16 ms intervals
Re: can't get emontx to report temp at 5 min interval
Correct! You must always check the documentation when you have an unexplained error like that.
Re: can't get emontx to report temp at 5 min interval
Hello Boelle/Robert
I added for (byte i = 0; i < 5; ++i) to ensure that my emontx updated every 5 minutes. But for some reason it updates every 6 minutes instead!
I have checked through the code, but cannot see why it updates every 6 instead of 5.
The file is attached.
Re: can't get emontx to report temp at 5 min interval
Try changing
(byte i = 0; i < 5; ++i)
to
(byte i = 0; i < 5; i++)
Re: can't get emontx to report temp at 5 min interval
I'll try that, thanks.