Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PL2303Relay ¶
type PL2303Relay struct {
// Value is the last value successfully written to the relays,
// or nil if no value has yet been written.
Value *byte
// contains filtered or unexported fields
}
PL2303Relay represents a set of USB-connected relays.
func New ¶
func New(device string) (*PL2303Relay, error)
New created a new PL2303Relay or returns an error if it is unable to open the device.
func (*PL2303Relay) Init ¶
func (p *PL2303Relay) Init() (count int, err error)
Init initialises the relay board and returns the number of relays available. This call can only be made once after the board gets power. If a second call is made then 0 will be returned, and the relays will be in an undefined state.
func (*PL2303Relay) Update ¶
func (p *PL2303Relay) Update(b byte) error
Update turns the relays on or off in a pattern described by b.
Click to show internal directories.
Click to hide internal directories.