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

    Class FourWire<L>

    A four-wire stepper driven coil by coil, through a transistor array such as a ULN2003 or an H-bridge, as pamoja_actuators::stepper::FourWire drives one in Rust.

    Each step energizes the coils the drive pattern names, coil A for the pattern's high bit down to coil D for its low bit, then waits the step interval. The position counts steps from where the motor was when the driver was built, forward positive. A coil line is any OutputLine: a GpioLine on a board, or a PinScript that records every level.

    const coils = [new PinScript(), new PinScript(), new PinScript(), new PinScript()] as const
    const motor = new FourWire(coils, StepDrive.FullStep, { delay: new DelayLog() })
    await motor.steps(2)
    motor.position // 2

    Type Parameters

    Index
    • get drive(): StepDrive

      The coil pattern in use.

      Returns StepDrive

    • get position(): number

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

      Returns number

    • get stepMicros(): number

      The pause after each step, in microseconds.

      Returns number

    • Drops every coil, so the motor holds nothing and draws nothing.

      Returns void

      Whatever a coil line throws when it cannot be driven.

    • Hands the coil lines back, for a test to read what was driven or a program to reuse them.

      Returns readonly [L, L, L, L]

      The lines for coils A, B, C, and D.

    • Takes one step and waits the step interval.

      Parameters

      Returns Promise<void>

      Whatever a coil 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 coil line throws; the steps already taken stay counted.