the build process puts function declarations (aka prototypes) at the top of the sketch. The parser that scans the sketch does not understand c++ so can't make sense of the default arguments. at least, thats what i suspect is happening.

You can get more detail on the build process here: http://www.arduino.cc/en/Hacking/BuildProcess

Hi, i was wondering about default arguments as well. Thanks for the explanation mem! To explain what prototypes are and what they're useful for (i had no idea about the latter):Excerpt from the wikipedia http://en.wikipedia.org/wiki/Function_prototype:

The function "fac" expects an integer argument to be on the stack when it is called. If the prototype is omitted, the compiler will have no way of enforcing this and "fac" will end up operating on some other datum on the stack (possibly a return address or the value of a variable that is currently not in scope). By including the function prototype, you inform the compiler that the function "fac" takes one integer argument and you enable the compiler to catch these kinds of errors.

www.arduino.cc/en/Hacking/BuildProcess says the following under "Transformations to the main sketch file":

Quote

... Next, the environment searches for function definitions within your main sketch file and prepends declarations (prototypes) for them to the top of your sketch. Note that these prototypes will appear before any type declarations or #include statements in your code, meaning that they cannot contain references to custom types.

It's unclear to me what the IDE does in case there is already a prototype for a function. I've no board here to test, but maybe you can define default arguments in a prototype on your own. that is, if the IDE does not overwrite them...something like this