I am using a sensor to asses luminosity. I am using this running avg code Arduino Playground - RunningAverage . I have no issue getting the running avg of the light sensor. For my project, I need to compare last reading to new reading. However, I cannot save (myRA.getAverage(), 3) or (myRA.getAverage(), 0) as a uint16_t global variable...... Although, I can print it no issue.
Note: the 'comma expressions' "(myRA.getAverage(), 3)" and "(myRA.getAverage(), 0)" are both the same as saying "myRA.getAverage()". There is nothing magical about the comma. It just separates two arguments to the .print() function. It does nothing to the float value. If the first argument to .print() is a 'float' value, the optional second argument tells .print() how many digits to show after the decimal point. The default is 2.
Thank you both! I did not even try breaking up the args . I did set to '0' second arg to get rid of x2 place holders....I will try 'float' too....will give it a shot when I get off work.....