setmaxspeed

ivanmason/accelstepper/setmaxspeed

Sets the maximum permitted speed. The run() function will accelerate up to the speed set by this function. Caution: the maximum speed achievable depends on your processor and clock speed. The default maxSpeed is 1.0 steps per second.
setmaxspeed
@/setmaxspeed
Sets the maximum permitted speed. The run() function will accelerate up to the speed set by this function. Caution: the maximum speed achievable depends on your processor and clock speed. The default maxSpeed is 1.0 steps per second.
DEV@/accelstepper-device
speednumber
The desired maximum speed in steps per second. Must be > 0.
UPDpulse
setmaxspeed
DEV
speed
UPD
DONE
DONEpulse
To use the node in your project you should have the ivanmason/accelstepper library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    if (!isInputDirty<input_UPD>(ctx))
        return;

    auto stepper = getValue<input_DEV>(ctx);
    float speed = getValue<input_speed>(ctx);

    stepper->setMaxSpeed(speed);
    
    emitValue<output_DONE>(ctx, 1);
}