Skip to content

provide a query to report pin values in bulk #59

@soundanalogous

Description

@soundanalogous

There already exists the Pin State Query which reports the output state (which is also the value) of a specified pin. There is also a use case for querying input values - especially when using non-serial transports. The Pin State Query is also inefficient when reporting several pins since the query is on a per pin basis.

The following proposal adds the ability to query the values of a range of pins including all pins, all input, all output, all digital input, all analog input, all digital output and all analog/pwm output.

Reporting of input pins would simply report the input pin value via the existing DIGITAL_MESSAGE or ANALOG_MESSAGE commands immediately upon receipt of the query. This is already done per pin (or port) when analog or digital pin reporting is enabled, but this proposal extends the ability to report at any time the user requests it - especially useful in the event that the transport connection was reestablished.

Reporting of output pins could use the Pin State Query Response, iterating over the output pins and sending the response for each pin.

0  START_SYSEX        (0xF0)
1  PIN_VALUE_QUERY    (0x68)
2  type                0 = all pins, 1 = all input, 2 = digital input, 3 = analog input,
                       4 = all output, 5 = digital output, 6 = analog output / pwm
3  END_SYSEX

Some additional types could be pin (input & output), pin_input, pin_output and then the following byte would be the pin number. Not sure if this would actually be useful, but it could be added later if a use case arises.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions