default arguments
does arduino version of c not allow use of default arguments functions?
i got following error when trying use one:
in function 'void moveservo(int, int, int)':
error: default argument given parameter 3 of 'void moveservo(int, int, int)' in function 'void moveservo(int, int, int)':
here's function:
i got following error when trying use one:
in function 'void moveservo(int, int, int)':
error: default argument given parameter 3 of 'void moveservo(int, int, int)' in function 'void moveservo(int, int, int)':
here's function:
code: [select]
void moveservo(int servopin, int pulsewidth, int time=0) {
serial.print(" #");
serial.print(servopin); //which servo move
serial.print(" p ");
serial.print(pulsewidth); // pulse width send
if (time != 0) {
serial.print(" t "); //temp command (time = 1 second)
serial.print(movetime);
}
}
the arduino build process has transformation step prototypes created , added top of sketch. guess prototype building prevents default arguments
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > default arguments
arduino
Comments
Post a Comment