-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL.txt
50 lines (30 loc) · 1.17 KB
/
INSTALL.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
BIG RED BUTTON - PYTHON DRIVER
==============================
SUPPORT
-------
This has only been developed & tested on an Ubuntu machine.
REQUIREMENTS
------------
- python 2.7.x
- python-usb
- lib-usb (I think)
ADDITIONAL
----------
When the button is pressed the 'onButtonDown' function is called, at the moment
(if your file system looks like mine!) this just executes the onbuttonpress.sh
script. There is example code in there for doing various strange things, the
best one is playing a random one of the sounds in the 'sounds' folder.
Yeah I know the code is *not* nicely structured, ideally there would be a
callback pattern or something used here. If you extend this code to make it
better please let me know / issue a pull request or something. =)
RUNNING
-------
You will need to run the script as a privileged user so it can communicate with
the USB device. So:
sudo python redbutton.py
THANKS
------
This code is directly based on the comment found on this page:
- http://www.lunarlamp.co.uk/usb-panic-button-linux#comment-108
It was also inspired by this perl module:
- http://search.cpan.org/~bkendi/Device-USB-PanicButton-0.04/lib/Device/USB/PanicButton.pm