MCP4725
所属分类:collect
开发工具:Swift
文件大小:0KB
下载次数:2
上传日期:2019-11-07 22:22:21
上 传 者:
sh-1993
说明: 用于与MCP4725 I2C 12位DAC.交互的Swift库。,
(Swift library for interacting with the MCP4725 I2C 12-bit DAC.,)
文件列表:
.swiftlint.yml (22, 2019-11-07)
.travis.yml (1687, 2019-11-07)
CONTRIBUTING.md (4011, 2019-11-07)
LICENSE (1068, 2019-11-07)
Package.swift (614, 2019-11-07)
Package@swift-4.swift (982, 2019-11-07)
Sources/ (0, 2019-11-07)
Sources/MCP4725.swift (4615, 2019-11-07)
# MCP4725
[![Build Status](https://github.com/Kaiede/MCP4725/workflows/CI/badge.svg)](https://github.com/Kaiede/MCP4725/actions)
[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)
![Swift](https://img.shields.io/badge/Swift-5.x-brightgreen.svg?style=flat)
![Swift](https://img.shields.io/badge/Swift-4.x-brightgreen.svg?style=flat)
![Swift](https://img.shields.io/badge/Swift-3.x-brightgreen.svg?style=flat)
![SwiftPM](https://img.shields.io/badge/SwiftPM--blue.svg?style=flat)
![Raspbian](https://img.shields.io/badge/OS-Raspbian-green.svg)
A Swift driver for the MCP4725 DAC over I2C, using SingleBoard.
## Getting Started
Pre-built boards using this in a 0-10V configuration can be found from Aptinex and ncd.io.
A breakout board that works in the 0-5V configuration is available from Adafruit.
A simple example looks like this:
```
// Most prototype boards have the default address as 0x62
// you can override this with an address parameter.
let mcp4725 = MCP4725(i2cBus: SingleBoard.raspberryPi.i2cMainBus)
// Voltages are the lower 12-bits of a 16-bit value. The top 4 bits are ignored.
// This writes a default setting into the EEPROM of the chip.
mcp4725.setDefault(voltage: 0, mode: .normal)
// Sets the voltage to maximum (5V)
mcp4725.set(voltage: 4095)
```
## Built With
* [SingleBoard](https://github.com/Kaiede/SingleBoard)
## Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
## Authors
* **Adam Thayer** - *Initial work* - [Kaiede](https://github.com/Kaiede)
See also the list of [contributors](https://github.com/Kaiede/RPiLight/contributors) who participated in this project.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
近期下载者:
相关文件:
收藏者: