<p>In this series a do whirl wind tour of the Python code I developed to control my PifaceCAD raspberry pi add on board. I this use to control a music player running on a remote raspberry pi upstairs.</p>
<p>In this episode I cover my use of global variables.</p>
<p>List of global variables along with associated comments explaining what they are used for</p>
<pre><code># GLOBAL VARIABLES

RemoteDevice = &quot;pi@192.168.1.13&quot;
# Username and ip address of the remote device to control

SeekMin = -6
# Sets the minimum value of the variable SeekPosition

SeekMax = 6
# Sets the maximum value of the variable SeekPosition

SeekPosition = 0
# stores seek menu position,

SeekMenu = False
# used to track seek menu state, ie are we in seek menu or not

FirstPass = True
# Used to track 1st time button 5 (backlight toggle) is pushed, turns off blinkstick

LcdLightOn = False
# used to track toggle sate of backlight button 5

MenuMin = 0
# Sets the minimum value of variable &quot;Menu&quot;

MenuMax = 2
# Sets the maximum value of variable &quot;Menu&quot;

Menu = 0
# global variable used to keep trak of selected menu

IrActive = False
# used to track toggle state of active infrared buttons, when false disables
# all buttons on the remote control except the blue button.

StoredTime = 0
# Stores curent time in seconds when a button is pushed, used by double button tap feature

#GET_IP_CMD = &quot;hostname –all-ip-addresses&quot;
# Debian 7 wheezy, Command to get IP adress

GET_IP_CMD = &quot;hostname --all-ip-addresses | cut -d&#39; &#39; -f1&quot;
# Debian 8 jessie, Command to get IP adress

#GET_ESSID_CMD = &quot;iwconfig wlan0 | grep &#39;ESSID:&#39; | cut -d&#39;:&#39; -f2&quot;
# Debian 7 wheezy, Command to get wifi ESSID

GET_ESSID_CMD = &quot;/sbin/iwconfig wlan0 | grep &#39;ESSID:&#39; | cut -d&#39;:&#39; -f2&quot;
# Debian 8 wheezy, Command to get wifi ESSID

GET_WIFI_STRENGTH_CMD = &quot;/sbin/iwconfig wlan0 | grep &#39;Link Quality=&#39; | awk &#39;{ print $2 }&#39;&quot;
# Command to get wifi signal strength</code></pre>
