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 ¶
NewI2CBoard creates a new Commodity Board instance that is able to communicate over I2C
func (*CommodityBoard) Heartbeat ¶
func (b *CommodityBoard) Heartbeat(t time.Duration)
Heartbeat shifts a bit on the board and blinks the blue led
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)
Click to show internal directories.
Click to hide internal directories.