Documentation
¶
Overview ¶
Package lightwavego is a LightwaveRF package for the Raspberry Pi.
Basic usage:
import (
"github.com/jimjibone/lightwavego"
"fmt"
)
func main() {
lwtx := lightwavego.NewLwTx()
lightOn, err := lightwavego.NewMessage([]byte{0x9,0xf,0x3,0x1,0x5,0x9,0x3,0x0,0x1,0x2}, 2, time.Millisecond * 500)
if err != nil {
fmt.Error(err)
}
lwtx.Send(lightOn)
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LwBuffer ¶
type LwBuffer [10]byte
LwBuffer contains the command you wish to send along with repeat configuration.
type LwCommand ¶
type LwCommand struct {
Command Command
Value int // 0-31 dim levels (TODO: Moods)
Device int
Address []byte
Room int
}
LwCommand is a helper struct to pull out the meaning of a LwBuffer, useful for logging.
type LwTx ¶
type LwTx struct {
Pin int // 22
Repeats int // 10
Invert bool // false
Translate bool // true
Period int // 140 (us)
}
LwTx contains the configuration of your LightwaveRF setup. The best way to create this struct, with all appropriate defaults, is to do the following e.g:
lwtx := lightwavego.NewLwTx()
func NewLwTx ¶
func NewLwTx() *LwTx
NewLwTx returns a pointer to a LwTx struct initialised with the recommended defaults.
func (*LwTx) SendBuffer ¶
Send a constructed LwBuffer via the 433 MHz module.
func (*LwTx) SendCommand ¶
Send a constructed LwCommand via the 433 MHz module.
Click to show internal directories.
Click to hide internal directories.