mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
0.1.1 ADG725
This commit is contained in:
parent
2101769982
commit
f25cac61c2
@ -3,14 +3,14 @@
|
||||
// FILE: ADG725.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// DATE: 2023-07-24
|
||||
// VERSION: 0.1.0
|
||||
// VERSION: 0.1.1
|
||||
// PURPOSE: Arduino library for ADG725 - 16 to 1 channel (2x) multiplexer
|
||||
// URL: https://github.com/RobTillaart/ADG725
|
||||
|
||||
|
||||
#include "Arduino.h"
|
||||
|
||||
#define ADG725_LIB_VERSION (F("0.1.0"))
|
||||
#define ADG725_LIB_VERSION (F("0.1.1"))
|
||||
|
||||
#define ADG725_ALLOFF 0x80 // ENable bit (false)
|
||||
#define ADG725_A_ONLY 0x20 // retain B
|
||||
|
@ -6,5 +6,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
|
||||
## [0.1.1] - 2023-10-16
|
||||
- update readme.md
|
||||
|
||||
|
||||
## [0.1.0] - 2023-07-24
|
||||
- initial version
|
||||
|
@ -2,8 +2,11 @@
|
||||
[![Arduino CI](https://github.com/RobTillaart/ADG725/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
|
||||
[![Arduino-lint](https://github.com/RobTillaart/ADG725/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/ADG725/actions/workflows/arduino-lint.yml)
|
||||
[![JSON check](https://github.com/RobTillaart/ADG725/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/ADG725/actions/workflows/jsoncheck.yml)
|
||||
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/ADG725.svg)](https://github.com/RobTillaart/ADG725/issues)
|
||||
|
||||
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/ADG725/blob/master/LICENSE)
|
||||
[![GitHub release](https://img.shields.io/github/release/RobTillaart/ADG725.svg?maxAge=3600)](https://github.com/RobTillaart/ADG725/releases)
|
||||
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/ADG725.svg)](https://registry.platformio.org/libraries/robtillaart/ADG725)
|
||||
|
||||
|
||||
# ADG725
|
||||
@ -15,24 +18,23 @@ Arduino library for ADG725 - 16 to 1 channel (2x) multiplexer.
|
||||
|
||||
**Experimental**
|
||||
|
||||
ADG725 is an Arduino class that controls two 16 to 1 multiplexers
|
||||
over a SPI like interface.
|
||||
Only one of the 16 channels can be connected at the same time.
|
||||
The channels can be set per multiplexer or together in one call.
|
||||
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.
|
||||
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 to
|
||||
This library can be used e.g. to connect 16 analog devices (potmeters) to
|
||||
one analog port, or to select between 16 DHT22 sensors.
|
||||
|
||||
Not tests with hardware have been done yet, so use with care.
|
||||
No tests with hardware have been done yet, so use with care.
|
||||
Feedback welcome!
|
||||
|
||||
|
||||
TODO insert picture.
|
||||
|
||||
|
||||
#### Related
|
||||
|
||||
- https://github.com/RobTillaart/HC4051 (1x8 mux)
|
||||
@ -40,7 +42,9 @@ TODO insert picture.
|
||||
- https://github.com/RobTillaart/HC4053 (3x2 mux)
|
||||
- https://github.com/RobTillaart/HC4067 (1x16 mux)
|
||||
- https://github.com/RobTillaart/ADG725 (2x16 mux)
|
||||
- https://github.com/RobTillaart/ADG726 (2x16 mux)
|
||||
- https://github.com/RobTillaart/ADG731 (1x32 mux)
|
||||
- https://github.com/RobTillaart/ADG732 (1x32 mux)
|
||||
|
||||
|
||||
## Interface
|
||||
@ -56,10 +60,10 @@ Valid values for channel are 0..15.
|
||||
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.
|
||||
- **uint8_t getChannelB()** get last set channel B == 0..15 or ADG725_ALLOFF.
|
||||
- **uint8_t channelCount()** returns 16 for ADG725.
|
||||
|
||||
- **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
|
||||
|
||||
@ -67,6 +71,7 @@ Valid values for channel are 0..15.
|
||||
|
||||
- improve documentation
|
||||
- test with hardware
|
||||
- keep in sync with ADG726 (interface)
|
||||
|
||||
#### Should
|
||||
|
||||
@ -79,3 +84,11 @@ Valid values for channel are 0..15.
|
||||
#### 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,
|
||||
|
||||
|
@ -20,10 +20,13 @@ void setup()
|
||||
delay(100);
|
||||
|
||||
start = micros();
|
||||
ADG.setChannel(0);
|
||||
for (int ch = 0; ch < 16; ch++)
|
||||
{
|
||||
ADG.setChannel(ch);
|
||||
}
|
||||
stop = micros();
|
||||
Serial.print("Time:\t");
|
||||
Serial.println(stop - start);
|
||||
Serial.println((stop - start) / 16.0);
|
||||
delay(100);
|
||||
|
||||
start = micros();
|
||||
|
@ -11,9 +11,11 @@ setChannelB KEYWORD2
|
||||
getChannelA KEYWORD2
|
||||
getChannelB KEYWORD2
|
||||
channelCount KEYWORD2
|
||||
allOff KEYWORD2
|
||||
|
||||
|
||||
# Constants (LITERAL1)
|
||||
ADG725_LIB_VERSION LITERAL1
|
||||
|
||||
ADG725_ALLOFF LITERAL1
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/ADG725"
|
||||
},
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"license": "MIT",
|
||||
"frameworks": "*",
|
||||
"platforms": "*",
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=ADG725
|
||||
version=0.1.0
|
||||
version=0.1.1
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Arduino library for ADG725 - 16 to 1 channel (2x) multiplexer.
|
||||
|
Loading…
Reference in New Issue
Block a user