Skip to content

Instantly share code, notes, and snippets.

@SeeJayDee
Created March 23, 2017 04:32
Show Gist options
  • Save SeeJayDee/6ad631eee1d6276db1b5d0280e584799 to your computer and use it in GitHub Desktop.
Save SeeJayDee/6ad631eee1d6276db1b5d0280e584799 to your computer and use it in GitHub Desktop.
package main
import (
"log"
"github.com/chbmuc/lirc"
)
func main() {
// Initialize with path to lirc socket
ir, err := lirc.Init("/var/run/lirc/lircd")
if err != nil {
log.Println(err)
panic(err)
}
// Send Commands
// This worked on a Raspberry Pi 3 Model B with an infra-red LED
// after following the instructions at:
// http://alexba.in/blog/2013/01/06/setting-up-lirc-on-the-raspberrypi/
err = ir.Send("samsung/BN59-00516A POWER")
if err != nil {
log.Println(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment