mcp3008

package
v0.0.0-...-3867a70 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdcMode

type AdcMode byte
const DifferentialMode AdcMode = 0x0
const SingleEndedMode AdcMode = 0x8

type Mcp3008

type Mcp3008 struct {
	// contains filtered or unexported fields
}

func New

func New(spiPort spi.Port, mode AdcMode) *Mcp3008

func (*Mcp3008) ReadChannel

func (adc *Mcp3008) ReadChannel(channel byte) (int, error)

func (*Mcp3008) ReadChannelAsPct

func (adc *Mcp3008) ReadChannelAsPct(channel byte) (float64, error)

func (*Mcp3008) ReadChannelAsVoltage

func (adc *Mcp3008) ReadChannelAsVoltage(channel byte) (float64, error)

Jump to

Keyboard shortcuts

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