This package is a fork of the DFRobot GP8403 package, modified for python3 and packaged for pip
Project description
DFRobot_GP8403
Fork from DFRobot GP8403 to bring this module to pypi.
This I2C to 0-5V/0-10V DAC module can be used to output voltage of 0-5V or 0-10V. It has the following features:
- Output voltage of 0-5V or 0-10V.
- It can control the output voltage with an I2C interface, the I2C address is default to be 0x58.
- The output voltage config will be lost after the module is powered down. Save the config if you want to use it for the next power-up.
Table of Contents
Summary
The Arduino library is provided for the I2C 0-5V/0-10V DAC module to set and save the output voltage config of the module. And the library has the following functions:
- Set the voltage of 0-5V or 0-10V directly;
- Output the corresponding voltage by setting the DAC range of 0-0xFFF;
- Save the voltage config(Will not be lost when powered down).
Installation
Install Module with pip
pip install DFRobot-GP8403
Example
import time
from DFRobot.DAC import GP8403
DAC = GP8403(0x58)
while DAC.begin() != 0:
print("init error")
time.sleep(1)
print("init succeed")
#Set output range
DAC.set_DAC_outrange(DAC.OUTPUT_RANGE_10V)
#Output value from DAC channel 0
DAC.set_DAC_out_voltage(4200,DAC.CHANNEL0)
Find more examples in examples
folder
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
DFRobot_GP8403-0.1.1.tar.gz
(6.1 kB
view hashes)
Built Distribution
Close
Hashes for DFRobot_GP8403-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ebd3e832e36573e0f36a0704b7208717eccc6673a3b9acb1a215b7793eada04 |
|
MD5 | 0fbff4fce44b86d981198b2685552d3c |
|
BLAKE2b-256 | e68d663be3d51cfe13bd913623fe85b60ce1a9684316d1d33f085b485d2848b7 |