CircuitPython library for control of LTC166X 8-bit and 10-bit DACs.
Project description
Introduction
CircuitPython library for control of LTC1665 8-bit and LTC1660 10-bit DACs from Linear Technologies.
Multiple LTC1665/LTC1660’s can be controlled from a single 3-wire serial port (i.e., SCK, DIN and CS/LD) by using the included “daisy-chain” facility. A series of n chips is configured by connecting each DOUT (except the last) to DIN of the next chip, forming a single 16n-bit shift register. The SCK and CS/LD signals are common to all chips in the chain. In use, CS/LD is held low while n 16-bit words are clocked to DIN of the first chip; CS/LD is then pulled high, updating all of them simultaneously.
Dependencies
This driver depends on:
Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.
Installing from PyPI
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:
pip3 install creativecontrol-circuitpython-ltc166x
To install system-wide (this may be required in some cases):
sudo pip3 install creativecontrol-circuitpython-ltc166x
To install in a virtual environment in your current project:
mkdir project-name && cd project-name
python3 -m venv .venv
source .env/bin/activate
pip3 install creativecontrol-circuitpython-ltc166x
Installing to a Connected CircuitPython Device with Circup
Make sure that you have circup installed in your Python environment. Install it with the following command if necessary:
pip3 install circup
With circup installed and your CircuitPython device connected use the following command to install:
circup install creativecontrol_circuitpython_ltc166x
Or the following command to update an existing version:
circup update
Usage Example
import time
import board
import creativecontrol_circuitpython_ltc166x
ltc1665 = creativecontrol_circuitpython_ltc166x.LTC1665(cs=board.GP1, sck=board.GP2, mosi=board.GP3, debug=True)
dac_values = [1, 3, 7, 15, 31, 63, 127, 255]
while True:
print('writing dac values ', time.monotonic())
ltc1665.write_dac_values(dac_values)
time.sleep(4)
print('off')
ltc1665.write_dac_values([0]*8)
time.sleep(4)
Documentation
For information on building library documentation, please check out this guide.
Contributing
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for creativecontrol-circuitpython-ltc166x-0.1.1rc2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e0937ceff07212f393fca9da8be375dfb33ff90d3ac054db941465f59509e95 |
|
MD5 | 9f2217497431501b0d5db34a409827c7 |
|
BLAKE2b-256 | c2ccf909a255ed2c998924a91542c365f5608ee66f5df390eeb9a8182c1e09ad |
Hashes for creativecontrol_circuitpython_ltc166x-0.1.1rc2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e364b6cbad7f3117a9ae06f19f3880c53b01ef4c407852c8631c3f38357286d |
|
MD5 | 4a3bea481d55b597fee5953520241c2d |
|
BLAKE2b-256 | f39a161840ece7ff407c5faa163c8d25bb846e990fab1fcc53c1f4473053988b |