pamoja for TypeScript - v0.2.0
    Preparing search index...

    Class StepDir<S, R>

    A stepper behind a step and direction driver chip such as an A4988 or a DRV8825, as pamoja_actuators::stepper::StepDir drives one in Rust.

    Each step sets the direction line, high for forward, and holds it for the pulse width, since the chip reads the direction on the step line's rising edge and needs it settled first. Then it pulses the step line high for the pulse width, brings it low, and waits the step interval. Microstepping, current limiting, and enable are the chip's own pins and settings, outside this driver.

    const motor = new StepDir(new PinScript(), new PinScript(), { delay: new DelayLog() })
    await motor.steps(-1)
    motor.position // -1

    Type Parameters

    Index
    • get position(): number

      The step count since the driver was built, forward positive.

      Returns number

    • get pulseMicros(): number

      How long the direction is held before each step pulse, and the pulse itself, in microseconds.

      Returns number

    • Hands the lines back.

      Returns readonly [S, R]

      The step line, then the direction line.

    • Takes one step and waits the step interval.

      Parameters

      Returns Promise<void>

      Whatever a line throws when it cannot be driven.

    • Takes count steps, backward when negative.

      Parameters

      • count: number

        The signed number of steps.

      Returns Promise<void>

      Whatever a line throws; the steps already taken stay counted.