ads1015

package
v0.0.0-...-83ac5ce Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Copyright 2017 Sebastien Soudan

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	V6_144 = iota
	V4_096 = iota
	V2_048 = iota
	V1_024 = iota
	V0_512 = iota
	V0_256 = iota
)
View Source
const (
	RangeMask  = 0x0E00
	RangeShift = 9
)
View Source
const (
	ConversionRegister = 0x0
	ConfigRegister     = 0x1
)
View Source
const (
	StartReadFlag = 0x8000
	BusyMask      = 0x8000
	SingleEnded   = 0x4000
	ChannelMask   = uint16(0x3000)
	ChannelShift  = 12
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ADS1015

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

func New

func New(bus byte, address byte) (*ADS1015, error)

New creates a new ADS1015 driver on a i2c bus of the Edison

func (ADS1015) GetResult

func (a ADS1015) GetResult(channel byte) (float32, error)

GetResult returns the current reading on a channel, scaled by the current scaler and presented as a floating point number.

func (*ADS1015) SetRange

func (a *ADS1015) SetRange(r VoltageRange) error

SetRange sets the voltage range

type VoltageRange

type VoltageRange uint16

Jump to

Keyboard shortcuts

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