spindle()

Controls the spindle operation.

If called with no arguments, it toggles the spindle state.
If called with one argument, it sets the spindle direction.
If called with two arguments, it sets the spindle direction and speed.

Syntax

spindle()
spindle(direction)
spindle(direction, rpm)

Parameters

Parameter Type Description
direction Number (Optional) `1` for clockwise, `-1` for counterclockwise, `0` to stop. optional
rpm Number (Optional) Spindle speed in revolutions per minute (RPM). optional

Return Value

Examples

Toggle spindle on/off

spindle();  

Start spindle clockwise

spindle(1);

Start spindle counterclockwise

spindle(-1);

Start spindle clockwise at 1200 RPM

spindle(1, 1200);

Stop spindle

spindle(0);

See also

output
output_pwm
output_rc

mist
flood
spindle

extout1
extout2