Turn off slew rate for Smart Motor Library

Is there a way to turn slew rate on and off for my motors in jpearman’s Smart Motor Library?

Call the SmartMotorSetSlewRate function on the motor(s) you want to disable and set slew rate to 0, for example.


SmartMotorSetSlewRate( port1, 0 );

disables slew rate on the motor on port 1.

If you want a command value to be sent directly to a motor you can also do that with the setMotor function. This is the prototype.

void SetMotor( int index, int value = 0, bool immeadiate = false );

The immeadiate flag is used to bypass slew rate for this command, so


SetMotor( port1, 100, true );

will send control value of 100 directly to the motor and bypass slew rate control.

I see, thank you! Is there a document where I can view all the functions available in the Smart Motor Library?

There’s some documentation in the github repo for the project, but it is not completely up to date.

but (even for me) the easiest way is just to look at the source code and the comments it includes.

make sure you are using that (still old) latest version.