Skip to content

cswank/ir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NEC Infrared Transmission Protocol Parse

IR is a library for parsing IR remote control signals.

After collecting IR signal pulses from a remote control into a slice, like in this tinygo example:

var i int
var t2 time.Time
t1 := time.Now()
pulses := make([]time.Duration, 200)
irPin.SetInterrupt(machine.PinToggle, func(p machine.Pin) {
    t2 = time.Now()
    pulses[i] = t2.Sub(t1)
    t1 = t2
    i++
})

The address and command from the remote button press can be decoded like:

addr, cmd, err := ir.Command(pulses)
fmt.Println(addr, cmd, err)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages