Added temp files pi
authorRaspberry Pi user <pi@njae.me.uk>
Sat, 15 Jun 2013 16:21:01 +0000 (16:21 +0000)
committerRaspberry Pi user <pi@njae.me.uk>
Sat, 15 Jun 2013 16:21:01 +0000 (16:21 +0000)
release/#gpio_test.py# [new file with mode: 0644]
release/gpio_test.py [new file with mode: 0644]
writeup/installing-python-gpio.txt [new file with mode: 0644]

diff --git a/release/#gpio_test.py# b/release/#gpio_test.py#
new file mode 100644 (file)
index 0000000..6d6f30c
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+from time import sleep
+import os
+import RPi.GPIO as GPIO
+GPIO.setmode(GPIO.BCM)
+GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
+GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
+while True:
+    if GPIO.input(17):
+        print('Pin 17')
+    if GPIO.input(18):
+        print('Pin 18')
+    sleep(0.1);
diff --git a/release/gpio_test.py b/release/gpio_test.py
new file mode 100644 (file)
index 0000000..2e909ee
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+from time import sleep
+import os
+import RPi.GPIO as GPIO
+GPIO.setmode(GPIO.BCM)
+GPIO.setup(17, GPIO.IN)
+GPIO.setup(18, GPIO.IN)
+while True:
+    if GPIO.input(17):
+        print('Pin 17')
+    if GPIO.input(18):
+        print('Pin 18')
+    sleep(0.1);
diff --git a/writeup/installing-python-gpio.txt b/writeup/installing-python-gpio.txt
new file mode 100644 (file)
index 0000000..03b05ae
--- /dev/null
@@ -0,0 +1,9 @@
+sudo aptitude update
+sudo aptitude full-upgrade
+sudo aptitude install python-dev
+
+# Install the Easy Installer
+wget https://bitbucket.org/pypa/setuptools/raw/0.7.2/ez_setup.py -O - | sudo python
+
+# Install the RPi.GPIO library
+sudo easy_install RPi.GPIO