That makes good sense. And still allows passing a floating point variable as the first parameter.
Dunno why the original only used 'long' as the first parameter. Very limiting.
// if the bottom of the scale is always zero
scaledReading = (rawReading / 1023.0) * scaleTop;
// otherwise
scaledReading = ((rawReading / 1023.0) * (scaleTop - scaleBottom)) + scaleBottom;
In a function deckaration you CAN'T use values, you have to use variable names. Only in the using of a function you can use numbers, the values of the passed variables, the ones you have declarated in declaration.
You can only use some default arguments (variables not necessary passed and that if they aren't they assume a specific value), but to do it you have to made a prototype of the function.
A prototype is like a declaration (only the first line) anded by a ; and located global. In prototypes you can add the default values, like this
function_type function_name (undefault parameter type u p n,... ...,... ..., default parameter type default parameter name=default parameter default value,dpt dpn=dpdv,...,...,...);
You can't have a undefoult parameter after a defoult one