Documentation ¶
Overview ¶
Package ezopmp is a motor driver for the hydrogarden pump
Index ¶
- func NewMotor(ctx context.Context, deps registry.Dependencies, c *Config, ...) (motor.LocalMotor, error)
- type Config
- type Ezopmp
- func (m *Ezopmp) GetPosition(ctx context.Context, extra map[string]interface{}) (float64, error)
- func (m *Ezopmp) GetProperties(ctx context.Context, extra map[string]interface{}) (map[motor.Feature]bool, error)
- func (m *Ezopmp) GoFor(ctx context.Context, mLPerMin, mins float64, extra map[string]interface{}) error
- func (m *Ezopmp) GoTillStop(ctx context.Context, rpm float64, stopFunc func(ctx context.Context) bool) error
- func (m *Ezopmp) GoTo(ctx context.Context, mLPerMin, mins float64, extra map[string]interface{}) error
- func (m *Ezopmp) IsMoving(ctx context.Context) (bool, error)
- func (m *Ezopmp) IsPowered(ctx context.Context, extra map[string]interface{}) (bool, error)
- func (m *Ezopmp) ResetZeroPosition(ctx context.Context, offset float64, extra map[string]interface{}) error
- func (m *Ezopmp) SetPower(ctx context.Context, powerPct float64, extra map[string]interface{}) error
- func (m *Ezopmp) Stop(ctx context.Context, extra map[string]interface{}) error
- func (m *Ezopmp) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { motor.Config BusName string `json:"bus_name"` I2CAddress byte `json:"i2c_address"` MaxReadBits int `json:"max_read_bits"` }
Config is user config inputs for ezopmp.
type Ezopmp ¶
type Ezopmp struct { I2CAddress byte generic.Unimplemented // contains filtered or unexported fields }
Ezopmp represents a motor connected via the I2C protocol.
func (*Ezopmp) GetPosition ¶
GetPosition will return the total volume dispensed.
func (*Ezopmp) GetProperties ¶ added in v0.0.9
func (m *Ezopmp) GetProperties(ctx context.Context, extra map[string]interface{}) (map[motor.Feature]bool, error)
GetProperties returns the status of optional features on the motor.
func (*Ezopmp) GoFor ¶
func (m *Ezopmp) GoFor(ctx context.Context, mLPerMin, mins float64, extra map[string]interface{}) error
GoFor sets a constant flow rate mLPerMin = rpm, mins = revolutions.
func (*Ezopmp) GoTillStop ¶
func (m *Ezopmp) GoTillStop(ctx context.Context, rpm float64, stopFunc func(ctx context.Context) bool) error
GoTillStop is unimplemented.
func (*Ezopmp) GoTo ¶
func (m *Ezopmp) GoTo(ctx context.Context, mLPerMin, mins float64, extra map[string]interface{}) error
GoTo uses the Dose Over Time Command in the EZO-PMP datasheet mLPerMin = rpm, mins = revolutions.
func (*Ezopmp) ResetZeroPosition ¶
func (m *Ezopmp) ResetZeroPosition(ctx context.Context, offset float64, extra map[string]interface{}) error
ResetZeroPosition clears the amount of volume that has been dispensed.
func (*Ezopmp) SetPower ¶
func (m *Ezopmp) SetPower(ctx context.Context, powerPct float64, extra map[string]interface{}) error
SetPower sets the percentage of power the motor should employ between -1 and 1. Negative power implies a backward directional rotational for this pump, it goes between 0.5ml to 105ml/min.