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

    Class PinScript

    A line for running with nothing plugged in: it answers the reads it was given, in order, and records every level it is driven to. It is what the examples and tests put under a Switch or a Contact, and the one thing a real node replaces with its board's pin library. It behaves as pamoja_hal::script::PinScript does in Rust: it starts released, high, and once its reads run out a read answers the level it was last driven to.

    Implements

    Index
    • Creates a released line.

      Parameters

      • Optionalinputs: readonly PinLevel[]

        The levels to answer reads with, in order.

      Returns gpio.PinScript

    • get driven(): readonly PinLevel[]

      Every level the line was driven to, oldest first.

      Returns readonly PinLevel[]

    • get level(): PinLevel

      The level the line was last driven to, high while it has never been driven.

      Returns PinLevel

    • get remaining(): number

      How many scripted reads are left.

      Returns number

    • Records a driven level.

      Parameters

      Returns void

    • Answers the next scripted level, or the driven level once the script runs out.

      Returns PinLevel

      The level.