Metadata-Version: 2.1
Name: DFRobot_GP8403
Version: 0.1.0
Summary: This package is a fork of the DFRobot GP8403 package, modified for python3 and packaged for pip
Home-page: https://github.com/joe2824/DFRobot_GP8403/
Author: Joel Klein
Project-URL: Bug Tracker, https://github.com/joe2824/DFRobot_GP8403/issues
Project-URL: Github, https://github.com/joe2824/DFRobot_GP8403/
Keywords: Raspberry Pi,Raspi,Python,GPIO,GP8403,DAC
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Requires-Python: >=3
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: smbus2

# DFRobot_GP8403
#### Fork from [DFRobot GP8403](https://github.com/DFRobot/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:
1. Output voltage of 0-5V or 0-10V.
2. It can control the output voltage with an I2C interface, the I2C address is default to be 0x58. 
3. 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](#summary)
  - [Installation](#installation)

## 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:
1. Set the voltage of 0-5V or 0-10V directly；
2. Output the corresponding voltage by setting the DAC range of 0-0xFFF；
3. Save the voltage config(Will not be lost when powered down).

## Installation
Install Module with pip<br>
```python
pip install DFRobot_GP8302
```

## Example
```python
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
