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:
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

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums