Back to godoc.org

Package mcp4725

v0.0.0-...-d3d8c0c
Latest Go to latest

The latest major version is .

Published: May 8, 2017 | License: MIT | Module: github.com/kidoman/embd

Overview

Package mcp4725 allows interfacing with the MCP4725 DAC.

Index

type MCP4725

type MCP4725 struct {
	// Bus to communicate over.
	Bus embd.I2CBus
	// Addr of the sensor.
	Addr byte
	// contains filtered or unexported fields
}

MCP4725 represents a MCP4725 DAC.

func New

func New(bus embd.I2CBus, addr byte) *MCP4725

New creates a new MCP4725 sensor.

func (*MCP4725) Close

func (d *MCP4725) Close() error

Close puts the DAC into power down mode.

func (*MCP4725) SetPersistedVoltage

func (d *MCP4725) SetPersistedVoltage(voltage int) error

SetPersistedVoltage sets the voltage and programs the EEPROM so that the voltage is restored on reboot.

func (*MCP4725) SetVoltage

func (d *MCP4725) SetVoltage(voltage int) error

SetVoltage sets the output voltage.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier