copied over all of the custom pcb stuff and switched connectors + added PWM headers to the power board

git-svn-id: https://robotics.mvla.net/svn/frc971/2013/trunk/src@4029 f308d9b7-e957-4cde-b6ac-9a88185e7312
diff --git a/gyro_board/src/usb/test.py b/gyro_board/src/usb/test.py
new file mode 100644
index 0000000..3344543
--- /dev/null
+++ b/gyro_board/src/usb/test.py
@@ -0,0 +1,44 @@
+#!/usr/bin/python
+
+global DeviceName, AddAction, RemoveAction
+DeviceName = 'usb_device_46d_c408_noserial' # Logitech Trackball
+AddAction = 'xmodmap -e "pointer = 3 2 1 4 5 6 7 9 8"'
+RemoveAction = 'xmodmap -e "pointer = 1 2 3 4 5 6 7 8 9"'
+
+import dbus # needed to do anything
+import dbus.decorators # needed to receive messages
+import dbus.glib # needed to receive messages
+import gobject # needed to loop & monitor
+import os # needed to 
+
+def add_device(*args, **keywords):
+    Path = args[0].split('/')
+    if Path[-1] == DeviceName: # Device found
+        os.system(AddAction)
+        
+def remove_device(*args, **keywords):
+    Path = args[0].split('/')
+    if Path[-1] == DeviceName: # Device found
+        os.system(RemoveAction)
+
+bus = dbus.SystemBus()  # connect to system bus
+hal_manager_obj = bus.get_object('org.freedesktop.Hal', '/org/freedesktop/Hal/Manager')
+hal_manager = dbus.Interface(hal_manager_obj, 'org.freedesktop.Hal.Manager')
+
+# Add listeners for all devices being added or removed
+bus.add_signal_receiver(add_device, 'DeviceAdded', 'org.freedesktop.Hal.Manager',
+                        'org.freedesktop.Hal', '/org/freedesktop/Hal/Manager')
+bus.add_signal_receiver(remove_device, 'DeviceRemoved', 'org.freedesktop.Hal.Manager',
+                        'org.freedesktop.Hal', '/org/freedesktop/Hal/Manager')
+
+# get list of all devices, determine if device is connected
+device_names = hal_manager.GetAllDevices()
+for name in device_names:
+    Path = name.split('/')
+    if Path[-1] == DeviceName: # Device found
+        os.system(AddAction)
+        break # no need to keep looking
+
+# monitor
+loop = gobject.MainLoop()
+loop.run()