-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathirled.go
26 lines (21 loc) · 845 Bytes
/
irled.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package cardputer
import (
"github.com/sparques/irtrx"
)
/*
Example: The below is equiavlent to pressing the forward button on a hexbug remote set to channel 1.
var cmd hexbug.Cmd = hexbug.CH1 | hexbug.CmdFwdMask
IRLED.SendFrame(cmd)
*/
// IRLED composites an irtrx.TxDevice, exposing SendPair(), SendPairs(), SendFrame(), and SendFrames().
// Currently only 38KHz is supported. To send signals, you can manually send on/off pairs using SendPair() or
// use something that implements irtrx.FrameMarshaller. For example, the github.com/sparques/irtrx/hexbug package
// has hexbug.Cmd which implements irtrx.FrameMarshller; with this you can control Hexbug robots.
//
// IRLED is initialized at start up, so it is ready to use immediately.
var IRLED = &irled{
TxDevice: irtrx.NewTxDevice(IRPin),
}
type irled struct {
*irtrx.TxDevice
}