Back to

Package mcp4725

Latest Go to latest

The latest major version is .

Published: May 8, 2017 | License: MIT | Module:


Package mcp4725 allows interfacing with the MCP4725 DAC.


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