https://github.com/patrickbaus/arduino-ad57x1
Arduino library for the Analog Devices AD5781/AD5791 18-/20-bit precision DAC
https://github.com/patrickbaus/arduino-ad57x1
arduino arduino-library dac precision
Last synced: 8 months ago
JSON representation
Arduino library for the Analog Devices AD5781/AD5791 18-/20-bit precision DAC
- Host: GitHub
- URL: https://github.com/patrickbaus/arduino-ad57x1
- Owner: PatrickBaus
- License: gpl-3.0
- Created: 2017-09-26T00:13:13.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-03-17T07:22:31.000Z (about 1 year ago)
- Last Synced: 2025-03-17T08:33:16.040Z (about 1 year ago)
- Topics: arduino, arduino-library, dac, precision
- Language: C++
- Size: 40 KB
- Stars: 6
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Arduino-AD57X1
This library is still work in progress and not all features of the DACs are supported. Basic functionality is implemented. More documentation will be added soon.
#### Examples
This is a simple example, to get going. Check out the more in depth examples in [/examples/](./examples/)
```C++
#include "src/Arduino-AD57X1/src/ad57X1.h"
#define CS_AD5781 7
AD5781 ad5781(CS_AD5781, &SPI); // Use AD5791 if using the 20 bit version
void setup() {
ad5781.begin(); // Set the pin modes
SPI.begin();
ad5781.setOffsetBinaryEncoding(true); // Set the input encoding to offset binary. Default is 2s complement (false).
ad5781.enableOutput(); // Turn on the DAC. After startup the output will be clamped to GND and disconnected (tri-state mode)
ad5781.setValue(0x3FFFF); // Set to full scale output
}
void loop() {
}
```