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_GP8302
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.0.tar.gz
(6.1 kB
view hashes)
Built Distribution
Close
Hashes for DFRobot_GP8403-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfa5d2bb1a41c2088fea978c37250d73281443eddf96c31cb0799eeef0d34a47 |
|
MD5 | 7f4d3971c894ec563b66119a6a3e8a9f |
|
BLAKE2b-256 | 8c22bf58d823cf95eeba7924b0382e08d7441a16ef87726afbc8afaff9fc9842 |