rpi.gpio refers to the package name of a Python module for accessing the Raspberry Pi's GPIO pins. The module allows GPIO pins to be initialised, turned on, and turned off. It uses a functional programming style.

learn more… | top users | synonyms

1
vote
1answer
24 views

2 things with python, import and exit

I am messing around with the GPIO and I am using my PI through SSH on my main desktop. First: with my script I am using from Adafruit_CharLCD import Adafruit_CharLCD I also tried ~/path/to/Ada... and ...
0
votes
1answer
70 views

GPIO.add_event_detect fires callback multiple times and on wrong signal edge

I'm trying to make an interrupt based matrix keypad reader that is loosely based off of this library. However, I'm getting some really weird effects when trying to use GPIO.add_event_detect in that: ...
2
votes
0answers
76 views

GPIO pins are always HIGH

I recently have started delving into using the GPIO on my raspberry pi and when I got to the input section of adafruit's tutorials I noticed something wrong. For some reason when I execute the python ...
1
vote
3answers
93 views

Control 18 LEDs individually? (17 GPIO pins)

Note: I have read Controlling many LEDs with few GPIO pins, but I can't buy additional parts (Degree project) The end result is to make a noughts and crosses grid with 2 LEDs per grid cell. This ...
0
votes
2answers
86 views

Disable i2c in Raspberry Pi

I want to disable the i2c in raspberry pi, so that I can use it as GPIOs. I commented the lines in the /etc/modprobe.d/raspi-blacklist.conf, but not working.
1
vote
1answer
66 views

How to use gpio7 & 8

I have a python script which uses board pins 7 & 8 but when I try to set the pins to output an exception occurs. GPIO.setmode(GPIO.BOARD); GPIO.setup(7,GPIO.OUT); ...
0
votes
0answers
29 views

Controlling a standard Bulb & Fan with Pi

I have been playing around with Pi for sometime now, and I am now able to do basic wiring to control LED using the command line of Raspbian in my Pi. However, now I want built something real. I want ...
1
vote
2answers
118 views

Can a raspberry pi accept input data if the input voltage is 42 mv when is required is 3.3v?

Im following this website using a different sensor and my output is too low for the GPIO so i don't know whether it effects anything as the program could not work.Can a raspberry pi accept input data ...
1
vote
1answer
94 views

To Access the gpios from webpage by executing python code

my self student in electronics department doing a project on home automation using raspberry pi(for bulbs,fan,temperature and camera) i want access the gpio pins from web interface to execute the ...
0
votes
1answer
37 views

How to connect slotted opto to raspberry pi?

I am trying to connect slotted opto ( TCST2300 ) to raspberry pi. I would like to receive 1/0 on GPIO input pin. Programming is not a problem but the circuit is. I referred following circuit But ...
3
votes
2answers
110 views

Why is 14 (board numbering system) listed as a GPIO pin, and not 13?

>>> RPIO.RPI_REVISION 2 >>> RPIO.GPIO_LIST_R2 (2, 3, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 22, 23, 24, 25, 27, 28, 29, 30, 31) Pin 14 is ground, shouldn't this be pin 13 instead?
3
votes
1answer
2k views

What is the difference between BOARD and BCM for GPIO pin numbering?

When using the RPi.GPIO library in python you have to call import RPi.GPIO as GPIO then GPIO.setmode(GPIO.BOARD) or GPIO.setmode(GPIO.BCM) What is the difference between these two options?
0
votes
1answer
76 views

Why am I getting segmentation fault with GPIO (bcm2835) functions?

So i'm having this function (code below) in c that checks data from my database. If this data equals 255 i want to have a LED to light on one of my GPIO pins (12) on the raspberry pi. I first tried ...
1
vote
2answers
139 views

Why does a time delay suddenly fix my code?

I'm trying to demonstrate how using a state machine can clarify the logic of most Raspberry Pi projects. All of the code is available as a gist, but the problem portion is around line 34: while ...
1
vote
2answers
143 views

Error when trying to control GPIO in python

I have installed RPi.GPIO and can import it into a python script fine without a error but as soon as i try to manipulate any of the gpio's i always get a error saying file "practice.py" line 5 in ...
1
vote
2answers
254 views

Shutdown properly when power-supply can't supply anymore

I've been through tags "power-supply" and "power" of this website and surfing on a lot more but I did not found any answers or information about the subject I'm about to talk about. So, I'm looking ...
0
votes
2answers
131 views

Not able to detect interrupt on GPIO 2

I have counter which is sending pulse every second to GPIO 2 and I wrote the following code to detect it #!/usr/bin/python import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(2, GPIO.IN, ...
0
votes
0answers
208 views

How to test RPi.GPIO setup?

After several maddening errors it occurs to me that there is a problem in my GPIO setup, to wit, RPi.GPIO is failing silently. To test this theory I got my multimeter, set it to volts, put one probe ...
1
vote
1answer
113 views

GPIO events fire from unrelated pins

I'm using the RPi.GPIO library to control a the GPIO pins on my RPi, I have a 12 bit ADC which is bit-banged to get the data in a similar manner to this tutorial on adafruit. This has been working ...
0
votes
0answers
120 views

How do I write an script for XBMC?

I am planning on installing XBMC on my Pi and then I want to add some functionality. I, of course being a developer, am going to add some extras to it. I am going to make an app so you can switch the ...
1
vote
2answers
254 views

PiFM not working for me

I followed the steps found here & consulted this site. But I just get complete silence on 100.1 or other frequencies. No sound at all. Please tell me what it means. I really want to see & use ...
1
vote
1answer
126 views

Is it advisable to use GPS module with 50mA current rating(TTL serial connection) described in the link below directly on Rpi?

See GPS Module with Antenna . My doubt is whether the module specified here will exceed the current limitations of RPi, if so how can i interface this to RPi? what is the current rating so that i ...
1
vote
3answers
1k views

Multiple Callbacks from GPIO interrupt

I created a quick program that uses the GPIO library to create an interrupt with a callback that is initiated when a (pink) button is pressed. It works, but when the button is pressed and then ...
10
votes
4answers
2k views

How can I use more GPIO ports on the Raspberry Pi?

I am currently planning a project for a course at school which involves using the Raspberry Pi - however I'm worried that I will not have enough GPIO connectors for the inputs and outputs that I will ...
1
vote
2answers
625 views

Raspberry pi SD card issue

once I had sd card corrupted, so I couldn't use it again for raspberry. Tried everything. Now different error. I disabled swap on sd card and placed my script files and some files on ram memory to ...
0
votes
0answers
378 views

Raspberry pi cannot read from GPIO using pi4J

I am ruuning the code at the bottom using java and pi4j library, pretty much the program checks is the pin is low and waits sometime before turning off the tv When I reboot my raspberry and run the ...
2
votes
1answer
130 views

How do I change the drive strength on GPIO

I believe you can change the drive strengths of the GPIO outputs. I need to drive one LED at 16mA. However I cant find anywhere where you can do this. I am using the RPI.GPIO python module so it would ...
0
votes
1answer
958 views

Python script failing with AttributeError: LED instance has no attribute '__trunc__'

I am currently bread-boarding two LEDs with 560 mOh resistors connected to the RPi over a ribbon cable that connects to the breadboard with a Pi Cobbler. The problem I am getting isn't with the ...
2
votes
1answer
753 views

Can a Raspberry Pi be operated at more than 115200 baud rate i.e : 230400

I am now working on a project where I have to integrate a wireless module which supports baud rate of 230400 to Rasp Pi. I came to know that baud rate can be tweaked in Raspberry Pi. Is there any ...
4
votes
2answers
136 views

Will the GPIO return data that is accurate out to .001 seconds?

Does anyone know how close I can measure time I would like to measure an event accurately to the thousands of a second?
5
votes
1answer
2k views

Toggling a GPIO pin set as output

I read here that I could toggle the state of a GPIO pin set to output in python using the following command: GPIO.output(LED, not GPIO.input(LED)) where LED is the pin value. I can turn the LED on ...
2
votes
1answer
2k views

Why can't I turn on an LED through Python?

I have an LED connected to pin 11 on the Raspberry Pi header, (also known as BCM/GPIO pin 17, and GPIO0). I have installed the Raspberry Pi Python library according to these instructions. Attempt 1 ...
1
vote
1answer
238 views

Why aren't GPIO_22 and GPIO_23 lighting up LEDs? (Beginner)

I'm losely following a traffic light tutorial where the following diagram has been provided: I've followed the diagram, only deviating from the tutorial to use RPi.GPIO in GPIO.BOARD mode.. I had no ...
3
votes
2answers
163 views

What type of motor and speaker would be suitable for a DIY: Making a Pi-powered baby mobile?

My neighbor is having his first child shortly, and in the spirit of "it's never too early to learn programming/electronics" we feel the child should have access to a Raspberry-Pi of his/her own. ...
1
vote
1answer
1k views

How to trigger GPIO event using an active infrared sensor

Trying to get an active infrared sensor to trigger an event on a GPIO pin. I'm using python and the RPi.GPIO library on an RPi model B. Some background info, not sure how relevant it is, but I'm a ...
2
votes
1answer
1k views

GPIO pin output stays high after setting to low

I'm working on a project in which I have to set a GPIO pin of the Raspberry Pi to high/low in order to signal a transponder which in turn communicates with a lock and opens it when it receives a high ...
1
vote
1answer
5k views

How to correctly install the python RPi.GPIO library

I downloaded RPi.GPIO 5.3a from here: https://pypi.python.org/pypi/RPi.GPIO I extracted the tar file, cd into the folder and ran: sudo python setup.py install It ran through a bunch of stuff and ...
0
votes
0answers
25 views

Error: âdigitalReadâ was not declared in this scope [on hold]

I am a noob and recently started programming on raspberry. Please tell me the header files I must include. I have already included spi.h, nrf24L01.h, RF24.h, Please also mention the way I should ...
0
votes
1answer
603 views

Relay working at 3.3V for RPi?

I need to use my RPi to control a relay which switches on/off an electrical circuit. I got a relay board but it seems that works only when used at 5V. I'm a noob so please go a bit easy on me.:P ...
0
votes
2answers
376 views

Does anyone know of any Accelerometers that are easy to use in Python

I'm fairly new to GPIO programming and robotics with the Raspberry Pi, and was wondering what I should look out for to avoid pitfalls later when buying an accelerometer. I've heard that the GPIO pins ...
3
votes
1answer
756 views

Attaching /Detaching interrupt in C Programming

How do I attach/detach interrupts in C language. I am currently working with GPIO Pins of Raspberry Pi and want to convert statements which I used for arduino: attachInterrupt(); ...
0
votes
2answers
232 views

Can I use this bridge with Raspberry Pi to drive 2 servos and a stepper motor?

I found this SainSmart L293D in amazon. I need to run 2 motors and a stepper motor for my project, the description says it can but I am not clear if they can do all the three at the same time. ...
1
vote
2answers
391 views

RF Module input is random

I have a attached a RF Transceiver to GPIO 24 and a receiver to GPIO 26. I setup a program: import RPi.GPIO as GPIO # to use Raspberry Pi board pin numbers GPIO.setmode(GPIO.BOARD) # set up the ...
1
vote
1answer
823 views

raspberry pi django and RPi

Did anyone installed RPi and use it in the django Python framework? I've tried to wire up a motion sensor with the django but I'm stuck while trying to use RPi.GPIO inside django view and I get:
3
votes
3answers
2k views

Thermostat using wireless relay

I want to create a thermostat with my Pi to control (also remotely) my heating boiler, using python if possible. Unfortunately I don't know much about electronics, so I'm asking your help just to ...
1
vote
1answer
398 views

Security issues in PHP executing PYTHON scrips

So I've got a PHP script thats capable of executing Python commands (to control GPIO), thanks to the users of StackExchange. My previous question here Now I'm able to control the GPIO pins from a ...
2
votes
3answers
7k views

PHP to execute Python scripts for GPIO

I found this code somewhere, that can execute Python scripts from PHP. I've installed apache2 on the Pi and I'm able to access the PHP script. But when I press the HTML buttons, nothing happens! :( ...
7
votes
1answer
578 views

Using additional GPIOs as digital I/O?

hopefully this question is rather simple but my quick googling did not find the answer. I know that the RPi has several GPIOs that I can use as well as specialized GPIOs (SPI, I2C, UART, etc). In my ...
2
votes
1answer
185 views

Is there a software block diagram that describes how a python call (e.g. GPIO) gets to the hardware?

Is there a software block diagram that describes how a python call (e.g. GPIO) gets to the hardware? I would assume there is a user/kernel interface. Maybe a kernel module that implements support ...
2
votes
2answers
900 views

GPIO input connected to garage door button

I would like to connect the garage door's button to a GPIO input on my Pi. I want to be able to trigger actions when someone pushes the button. I am able to read the status of a basic switch using ...