<p>This is the last show in the series. The series was recorded in one go and split into multiple parts. This last section is pretty short; it covers the main program section at the bottom of my script that calls all the other functions and allows the user to quit the program. In this episode I also mention explanatory notes that I included in my script. These are mainly for my own benefit so I could remember how I set up lirc. I’ve included these notes at the end of these show notes.</p>
<p><b>Main program</b><br />
Turn LCD backlight on, print <em>System up</em> message to LCD, wait a few seconds then clear screen. Activate push buttons on control and display board. Activates various IR buttons waiting on input from the remote control. Print quit message to terminal, waiting for input, repeat message until q is entered by user. When q is entered deactivate buttons and turn LCD backlight off.</p>
<p>Below are my Lirc explanatory comments at the end of my Python script.</p>
<blockquote>
<p><code>lirc</code><br />
This is the Linux IR control program<br />
LIRC (Linux Infrared remote control) is an open source package that allows users to receive and send infrared signals with a Linux-based computer system.</p>
<p><code>Irrecord</code><br />
Tool used to record valid IR codes from your remote control. It generates the file <code>/etc/lirc/lircd.conf</code>, possibly overwrites original file so use with caution. It attempts to recognise your remote control from a series of button pushes. If the remote is not recognised then it captures the codes in raw mode, I abandoned this tool and got a valid IR file for a very similar remote control on the internet, see info below</p>
<p><code>/etc/lirc/lircd.conf</code><br />
File used to store IR codes for your remote control, either using the tool <code>irrecord</code> or from somewhere on the internet. This file is a direct copy of file <code>"BN59-00861A-SAMSUNG-TV.conf"</code> I added the Samsung TV string to the file name.</p>
<p><code>irw</code><br />
Tool used to get the key names for your particular remote control, for this to work you must first have a valid <code>/etc/lirc/lircd.conf</code> file</p>
<p><code>~/.lircrc</code><br />
This file is used to store the remote control key names that you want to activate, and what action is to be taken when the button is pushed. Adding the field <code>"remote ="</code> allows the use of multiple remote controls. The remote control key names can be found by using the command <code>"irw"</code>, I created a file called <code>~/scripts/remote-key-names-sorted.txt</code> to store the valid key names for my Samsung remote control</p>
<p><code>~/scripts/remote-key-names-sorted.txt</code><br />
List of valid remote control key names for my Samsung remote control, this was generated using the <code>irw</code> command. I used the <code>"tee"</code> command to pipe output to the screen and write output to this file at the same time, see file for further details of commands I used.</p>
</blockquote>
