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)