board

package
v0.0.0-...-c931383 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	I2CAddr  = 0x20
	I2CBus   = "1"
	I2CSpeed = 400 * physic.KiloHertz
)
View Source
const (
	EnvReg     = 0xa1
	EnvDataLen = 12

	TemperatureKey = "env_temp"
	PressureKey    = "env_press"
)
View Source
const (
	LedReg     = 0xb2
	LedDataLen = 3
	RedLed     = 0
	YellowLed  = 1
	BlueLed    = 2
)
View Source
const (
	PowerReg     = 0xa0
	PowerDataLen = 12

	VoltageKey = "power_volt"
	CurrentKey = "power_amp"
	PowerKey   = "power_watt"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommodityBoard

type CommodityBoard struct {
	Bus i2c.BusCloser
	Dev *i2c.Dev
	// contains filtered or unexported fields
}

func NewBoard

func NewBoard(ctx context.Context, db *bbolt.DB, ec chan error) (*CommodityBoard, error)

NewI2CBoard creates a new Commodity Board instance that is able to communicate over I2C

func (*CommodityBoard) Close

func (b *CommodityBoard) Close()

Close is used to close ... @todo

func (*CommodityBoard) Heartbeat

func (b *CommodityBoard) Heartbeat(t time.Duration)

Heartbeat shifts a bit on the board and blinks the blue led

func (*CommodityBoard) Start

func (b *CommodityBoard) Start()

Start is used to start ... @todo

func (CommodityBoard) SwitchLed

func (b CommodityBoard) SwitchLed(led int) error

func (CommodityBoard) SyncEnv

func (b CommodityBoard) SyncEnv(t time.Duration)

func (CommodityBoard) SyncPower

func (b CommodityBoard) SyncPower(t time.Duration)

Jump to

Keyboard shortcuts

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