GY-63_MS5611/libraries/ADG725/README.md
2023-10-16 16:00:24 +02:00

3.4 KiB

Arduino CI Arduino-lint JSON check GitHub issues

License: MIT GitHub release PlatformIO Registry

ADG725

Arduino library for ADG725 - 16 to 1 channel (2x) multiplexer.

Description

Experimental

ADG725 is an Arduino class that controls two 16 to 1 multiplexers (or 1 to 16 multiplexer) over a SPI like interface.

The channel selection is disjunct which means that only
one of the 16 channels can be connected (selected) at the same time. The channels can be set per multiplexer or together (same channel) in one call. The library also support to set them all off (17th state).

On power-up, all switches are in the OFF state, so no channel is selected.

This library can be used e.g. to connect 16 analog devices (potmeters) to one analog port, or to select between 16 DHT22 sensors.

No tests with hardware have been done yet, so use with care. Feedback welcome!

Interface

#include "ADG725.h"
  • ADG725(uint8_t clockPin, uint8_t dataPin, uint8_t syncPin) constructor.
  • void setChannel(uint8_t channel) set the current channel for both A and B. Valid values for channel are 0..15.
  • void setChannelA(uint8_t channel) set the current channel for A only. Valid values for channel are 0..15.
  • void setChannelB(uint8_t channel) set the current channel for B only. Valid values for channel are 0..15.
  • uint8_t getChannelA() get last set channel A == 0..15 or ADG725_ALLOFF (128).
  • uint8_t getChannelB() get last set channel B == 0..15 or ADG725_ALLOFF (128).
  • uint8_t channelCount() returns 16 for ADG725, convenience for loops.
  • void allOff() sets all channels to OFF, no channel selected.

Future

Must

  • improve documentation
  • test with hardware
  • keep in sync with ADG726 (interface)

Should

  • add examples
  • check performance

Could

Wont

Support

If you appreciate my libraries, you can support the development and maintenance. Improve the quality of the libraries by providing issues and Pull Requests, or donate through PayPal or GitHub sponsors.

Thank you,