mcp3008

package
Version: 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: 2 Imported by: 2

Documentation

Overview

Package mcp3008 allows interfacing with the mcp3008 8-channel, 10-bit ADC through SPI protocol.

Index

Constants

View Source
const (
	// SingleMode represents the single-ended mode for the mcp3008.
	SingleMode = 1

	// DifferenceMode represents the diffenrential mode for the mcp3008.
	DifferenceMode = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MCP3008

type MCP3008 struct {
	Mode byte

	Bus embd.SPIBus
}

MCP3008 represents a mcp3008 8bit DAC.

func New

func New(mode byte, bus embd.SPIBus) *MCP3008

New creates a representation of the mcp3008 convertor

func (*MCP3008) AnalogValueAt

func (m *MCP3008) AnalogValueAt(chanNum int) (int, error)

AnalogValueAt returns the analog value at the given channel of the convertor.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto