GY-63_MS5611/libraries/Multiplex
2021-05-28 13:17:38 +02:00
..
.github/workflows add arduino-lint 2021-05-28 13:17:38 +02:00
examples 2021-01-29 2021-01-29 12:31:58 +01:00
test 2021-01-29 2021-01-29 12:31:58 +01:00
.arduino-ci.yml 2021-01-29 2021-01-29 12:31:58 +01:00
keywords.txt 2021-01-29 2021-01-29 12:31:58 +01:00
library.json 2021-01-29 2021-01-29 12:31:58 +01:00
library.properties add arduino-lint 2021-05-28 13:17:38 +02:00
LICENSE 2021-01-29 2021-01-29 12:31:58 +01:00
Multiplex.cpp 2021-01-29 2021-01-29 12:31:58 +01:00
Multiplex.h 2021-01-29 2021-01-29 12:31:58 +01:00
README.md update libs 2021-04-07 13:31:22 +02:00

Arduino CI License: MIT GitHub release

Multiplex

Arduino Library implementing a stream multiplexer.

Description

Multiplex is a library in which one can add multiple Print streams. If one prints to the multiplexer it is sent to all the streams that were added. The maximum nr of streams to add is 4 . It is possible to disable individual streams.

Interface

Constructor

  • Multiplex() constructor
  • void reset() resets to zero streams in the multiplexer.

Core

  • size_t write(uint8_t c) workhorse of the print interface.
  • bool add(Print * stream) add another print stream. Returns false if no space left.

Control

  • uint8_t count() returns # streams, MAX 4 in initial release
  • uint8_t size() returns size which is 4 in the current release.
  • void enable(uint8_t index) enable the stream at index.
  • void disable(uint8_t index) disable the stream at index.
  • bool isEnabled(uint8_t index) checks if the stream at index is enabled.

Future

  • set size in constructor
  • add names?
  • bool inMp(stream)
  • add returns int index? or 0xFF for fail
  • remove a stream from the multiplex ??? => complexer admin.
  • increase up to 8 streams. (pack enabled flag in one byte)

Operation

See examples