mcp4725

package
v0.0.0-...-d3d8c0c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package mcp4725 allows interfacing with the MCP4725 DAC.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL