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.

              Source Files