From: Raspberry Pi user Date: Sat, 15 Jun 2013 16:21:01 +0000 (+0000) Subject: Added temp files X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=3084f9e6e47be65cb9341f8ad9791cafe3f54257;p=miniband.git Added temp files --- diff --git a/release/#gpio_test.py# b/release/#gpio_test.py# new file mode 100644 index 0000000..6d6f30c --- /dev/null +++ b/release/#gpio_test.py# @@ -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 index 0000000..2e909ee --- /dev/null +++ b/release/gpio_test.py @@ -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 index 0000000..03b05ae --- /dev/null +++ b/writeup/installing-python-gpio.txt @@ -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