mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
0.2.1 AD5245
This commit is contained in:
parent
b57f263e56
commit
1ad081a174
@ -1,7 +1,7 @@
|
||||
//
|
||||
// FILE: AD5245.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.2.0
|
||||
// VERSION: 0.2.1
|
||||
// PURPOSE: Arduino library for I2C digital potentiometer AD5245.
|
||||
// DATE: 2022-07-31
|
||||
// URL: https://github.com/RobTillaart/AD5245
|
||||
@ -26,7 +26,6 @@ AD5245::AD5245(const uint8_t address, TwoWire *wire)
|
||||
#if defined (ESP8266) || defined(ESP32)
|
||||
bool AD5245::begin(uint8_t dataPin, uint8_t clockPin)
|
||||
{
|
||||
_wire = &Wire;
|
||||
if ((dataPin < 255) && (clockPin < 255))
|
||||
{
|
||||
_wire->begin(dataPin, clockPin);
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// FILE: AD5245.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.2.0
|
||||
// VERSION: 0.2.1
|
||||
// PURPOSE: Arduino library for I2C digital potentiometer AD5245.
|
||||
// DATE: 2022-07-31
|
||||
// URL: https://github.com/RobTillaart/AD5245
|
||||
@ -14,7 +14,7 @@
|
||||
#include "Wire.h"
|
||||
|
||||
|
||||
#define AD5245_LIB_VERSION (F("0.2.0"))
|
||||
#define AD5245_LIB_VERSION (F("0.2.1"))
|
||||
|
||||
|
||||
#define AD5245_OK 0
|
||||
|
@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
|
||||
## [0.2.1] - 2023-08-02
|
||||
- add Wire1 support for ESP32
|
||||
- update readme.md
|
||||
|
||||
|
||||
## [0.2.0] - 2023-01-16
|
||||
- Fix #4 Wire bug
|
||||
|
||||
@ -17,12 +22,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- Add AD5245_MIDPOINT constant
|
||||
- update readme.md
|
||||
|
||||
|
||||
## [0.1.1] - 2022-10-25
|
||||
- Add RP2040 support to build-CI.
|
||||
- Add CHANGELOG.md
|
||||
- minor edits
|
||||
|
||||
## [0.1.0] -2022-07-31
|
||||
## [0.1.0] - 2022-07-31
|
||||
- initial version (stripped from AD524X)
|
||||
|
||||
|
@ -2,45 +2,70 @@
|
||||
[![Arduino CI](https://github.com/RobTillaart/AD5245/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
|
||||
[![Arduino-lint](https://github.com/RobTillaart/AD5245/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/AD5245/actions/workflows/arduino-lint.yml)
|
||||
[![JSON check](https://github.com/RobTillaart/AD5245/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/AD5245/actions/workflows/jsoncheck.yml)
|
||||
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/AD5245.svg)](https://github.com/RobTillaart/AD5245/issues)
|
||||
|
||||
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/AD5245/blob/master/LICENSE)
|
||||
[![GitHub release](https://img.shields.io/github/release/RobTillaart/AD5245.svg?maxAge=3600)](https://github.com/RobTillaart/AD5245/releases)
|
||||
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/AD5245.svg)](https://registry.platformio.org/libraries/robtillaart/AD5245)
|
||||
|
||||
|
||||
# AD5245
|
||||
|
||||
Arduino library for I2C single channel digital potentiometer AD5245.
|
||||
|
||||
The library is experimental and not tested yet.
|
||||
The library is experimental and not tested with hardware yet.
|
||||
|
||||
|
||||
## Description
|
||||
|
||||
The AD5245 is a single channel digital potentiometer which comes in
|
||||
10K, 100K and 1M and can be set in 256 steps.
|
||||
5 kΩ, 10 kΩ, 50 kΩ, 100 kΩ and can be set in 256 steps.
|
||||
|
||||
Indicative step size.
|
||||
|
||||
| value | step size |
|
||||
|:--------:|:-----------:|
|
||||
| 5 kΩ | 19.53 Ω |
|
||||
| 10 kΩ | 39.06 Ω |
|
||||
| 50 kΩ | 195.3 Ω |
|
||||
| 100 kΩ | 390.6 Ω |
|
||||
|
||||
|
||||
An important property of the device is that it defaults
|
||||
to the mid position at startup.
|
||||
One can use **AD5245_MIDPOINT** == 128 to reset to the mid position.
|
||||
to the mid-scale position at startup.
|
||||
One can use **AD5245_MIDPOINT** == 128 to reset to the mid-scale position.
|
||||
|
||||
|
||||
#### Related libraries
|
||||
#### Related
|
||||
|
||||
This library is based upon the AD524X library, and triggered by this issue:
|
||||
- https://github.com/RobTillaart/AD524X/issues/11
|
||||
|
||||
- - https://www.analog.com/en/products/ad5245.html
|
||||
- https://github.com/RobTillaart/AD520X/
|
||||
- https://github.com/RobTillaart/AD524X/
|
||||
- https://github.com/RobTillaart/AD5245/ potentiometer
|
||||
- https://github.com/RobTillaart/AD5246/ rheostat
|
||||
|
||||
|
||||
## I2C address
|
||||
|
||||
The AD5245 has one address line to configure the I2C address.
|
||||
|
||||
| Addr(dec)| Addr(Hex) | AD0 |
|
||||
|:--------:|:---------:|:-----:|
|
||||
| Address(dec)| Address(Hex) | AD0 |
|
||||
|:-----------:|:------------:|:-----:|
|
||||
| 44 | 0x2C | GND |
|
||||
| 45 | 0x2D | +5V |
|
||||
|
||||
The maximum I2C speed is 400 KHz.
|
||||
|
||||
|
||||
## Interface
|
||||
|
||||
```cpp
|
||||
#include AD5245.h"
|
||||
```
|
||||
|
||||
The library has a number of functions which are all quite straightforward.
|
||||
One can get / set the value of the potentiometer.
|
||||
|
||||
@ -74,3 +99,12 @@ The examples show the basic working of the functions.
|
||||
- sync with AD524X library
|
||||
- reset ==> midScaleReset() ? AD524X alike
|
||||
|
||||
|
||||
## 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,
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "AD5245",
|
||||
"keywords": "I2C,digital,PotentioMeter, AD5245",
|
||||
"description": "Library to control digital potentiometer AD5245",
|
||||
"keywords": "I2C, digital, potentioMeter, AD5245",
|
||||
"description": "Arduino Library for AD524e, I2C 256 step potentiometer.",
|
||||
"authors":
|
||||
[
|
||||
{
|
||||
@ -15,9 +15,9 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/AD5245"
|
||||
},
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"license": "MIT",
|
||||
"frameworks": "arduino",
|
||||
"frameworks": "*",
|
||||
"platforms": "*",
|
||||
"headers": "AD5245.h"
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=AD5245
|
||||
version=0.2.0
|
||||
version=0.2.1
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Arduino Library for AD5245 digital potentiometer.
|
||||
|
Loading…
Reference in New Issue
Block a user