OK another try:
here's the rounding (up) function, to be placed after the loop function in the sketch:
int Ceiling(int input, int ceilTo)
//input is the integer number to be rounded
//ceilTo is the desired rounding (up) value
{
if ((input % ceilTo) != 0)
{
return ((int)(input / ceilTo) * ceilTo) + ceilTo;
}
else
{
return (input);
}
}
After the sensor input is read in the sketch, e.g. light level, insert the line
lightLevel = Ceiling(lightLevel,10);
Rounds all light level values upwards to the nearest 10. Depending on your rounding value, this will reduce the number of times the sensor sends an update to the gateway since updates are only sent when the value is different from the one previously sent.