Function Declaration and Function Prototypes: function prototype allowing the function to be used before it is defined.
functionReturnType myFunctionName(optionalArgumentType optionalArgument = defaultValue); |
Function Implementation
functionReturnType myFunctionName(optionalArgumentType optionalArgument); |
Function calls
myFunctionName(); // Use the default value |
Example
int myFunction(int optionalArgument = 1); void setup() { Serial.begin(9600); } void loop() { Serial.println(myFunction()); // Use the default value Serial.println(myFunction(2)); // Use specific value } int myFunction(int optionalArgument) { return optionalArgument; }