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
27 views

WiringPi + softPwm calculation to determine duty cycle

For my project we got a pre-installed rpi with all the working libraries and an example program to set a servo in middle position. The info: in a period of 20ms (50hz) we need 1,5ms to set it to ...
0
votes
0answers
23 views

Errors out with no explanation when trying to run a blinking light function in python

I have created a python script to press a button and have my light blink but it isn't working when I transported the function to my main script and it errors out with no information so I don't know ...
1
vote
2answers
41 views

My 3V relay doesn't work on GPIO but works on 5V pin with resistor

Ok, I have this awkward situation. I have a 3V relay that I need to implement in my project. When I connect it to a 5V pin on RPi, everything's working fine, I can hear the coil opening and current ...
0
votes
2answers
65 views

How can I exit a while loop at any time during the loop?

I have a python program that loops through some GPIO commands. How can I break the loop at any time during the loop by pressing the Enter key. So far I have this... import sys import select import os ...
0
votes
0answers
44 views

GPIO pins are not working

I have connected the LED as shown in picture below on GPIO #18: And I ran following program: import RPi.GPIO as GPIO, time GPIO.setmode(GPIO.BCM) GREEN_LED = 18 GPIO.setup(GREEN_LED, GPIO.OUT) ...
0
votes
1answer
49 views

Python script to conttrol GPIO

I have a very small python script to control GPIOs: pi@raspberrypi ~ $ sudo python gpio-test.py #!/usr/bin/env python try: from time import sleep import os import RPi.GPIO as GPIO ...
1
vote
2answers
244 views

RF24 communication with Arduino

I have been trying for ages to work this problem out and can't figure it out. I have two nrf24 transceivers, one connected to the raspberry pi and the other connected to an Arduino. My code for the ...
6
votes
2answers
483 views

What hardware do I need to turn Raspberry Pi into a TV remote controller?

I would like to control my TV using a Raspberry Pi. I would like my Raspberry Pi to act like a TV remote controller. What kind of hardware do I need to make it? Do I need something like IR emitter, ...
0
votes
0answers
51 views

how to read from a GPIO pin when it changes?

I create an app that must detect when the lights(LEDs) changes their status (on->off or off->on) monitor this to a site.I create this app in client side with node.js and use rpi.GPIO package from ...
1
vote
0answers
56 views

Adafruit 16x2 RGB LCD scrolling down?

So I'm working on a little project to show a fortune on this 16x2 LCD. I've been successful so far, but when it came to longer fortunes, it would just cut off. How would I go about scrolling downwards ...
0
votes
0answers
30 views

GPIO goes high on first initial run of script - please help get my ECTO 1 on the road!

I am having a few problems with my script, on a fresh boot of my pi, the GPIO Port goes High and switches my relay when I run this script, however, it doesn't do it after I initially run the script, ...
1
vote
1answer
70 views

Can't PWM LED on pin 18

Using this code, I can't use PWM on the pi. It's modified off of a Linux user article. import time import RPi.GPIO as GPIO led = 18 GPIO.setmode(GPIO.BCM) GPIO.setup(led, GPIO.OUT) ...
0
votes
1answer
56 views

display LED Blink Count on I2C 16x2 LCD

I want to blink a LED and display its count on I2C 16x2 LCD. But LED is not glowing at all. I used https://www.adafruit.com/product/1115 which uses i2c . I connected LED with 270ohm resister between ...
1
vote
1answer
56 views

Operational error when writing to database in Raspberry Pi's Python [closed]

I'm having an operational error when trying to run IDLE program (Python) in Raspberry Pi and it prompt me an error sentences: Traceback (most recent call last): File "/var/www/Sensor-LED.py", line ...
2
votes
1answer
94 views

Interrupting a Program with a Button

Currently tying to stop the middle of a command if the user presses a certain button. I tried this bit of code below and it doesn't seem to work. I know that you can use control-C to have a ...
0
votes
1answer
34 views

Simple LED code says that object has no attribute output?

I installed RPi.GPIO .5.1 and my uber basic led code says that the object has no attribute 'output'. I am hooking up the 12 pin to the Breadboard and I have ground hooked up too. Here is my python ...
0
votes
2answers
86 views

Multiple Inputs through GPIO

I am currently trying to create a program that does something each time a button is pushed, it seems simple but for me this has been very difficult to acomplish. I am on python 2.7 (but I can go to 3 ...
1
vote
3answers
93 views

how to turn on and off an led with only a tactile button

I'm a beginner to the raspberry pi and python. I want the pi to act like a flip flop to the led so that when i push the button once, it will turn on and if I push it again, it will turn off and so ...
1
vote
1answer
59 views

Use GPIO as GND

I am trying to connect a circuit like this. GPIO25 -- LED -- GPIO24 and I try to turn the LED on by exporting both GPIO and setting 0 in GPIO24, 1 in GPIO25. but it fails. Is there any way to ...
0
votes
1answer
157 views

Controlling Buzzer Module - No sound

The wiring seemed pretty trivial as did the required code. I have the following buzzer module: ...
0
votes
1answer
116 views

Unable to write to GPIO pins using gpio command line utility

I'm just done with installing ArchLinux ARM. I've also installed the RPi.GPIO and WiringPi packages. The problem is this: Through the command line, using the gpio utility, I am able to change the ...
1
vote
1answer
179 views

Using Bluetooth to control GPIO pins

I have 5 strips of LEDs that are linked up to 5 transistors, nothing special. I want to be able to create an android app that when I press a button it sends a command via Bluetooth to the Raspberry Pi ...
5
votes
3answers
337 views

Display IP Address on Character Based LCD

I need to know the IP address of my raspberry pi. I need to do this with a Character LCD display. So here's what I have done so far. I can display text on a HD44780 based 16x2 LCD connected to my ...
0
votes
2answers
164 views

Using a Pi as an EEPROM programmer

I'm making my own 8-bit homebrew computer and the only part left to figure out is how I'm going to program the parallel input EEPROM chip I'll be using (IC number: 28C256). I'd like to ask those with ...
1
vote
1answer
119 views

Record audio in python when button pressed

I'm trying to set it up so that I can record some audio using RPi.GPIO and pyaudio using a button press to determine the record time (hold to record). However, whenever I press the button, the program ...
-1
votes
1answer
52 views

/sys/devices/virtual/gpio this path not found in my PI

/sys/devices/virtual/gpio this path not found in my Pi, how i can do for access with : nodejs require('pi-gpio')
1
vote
2answers
46 views

Why don't I need time:sleep() for talking with a 10MHz chip?

I'm learning to control a MCP4131 digital potentiometer with the RPi. I've successfully used the MCP4131 by sending my data to the SDI pin, and then a HIGH value to the CLK followed by sending a LOW ...
0
votes
1answer
49 views

RPI with GPIO connector AND micro usb Power supply?

if I use both the GPIO connector and the micro usb does this double the Amper value and the voltage value or only the amper value ?
0
votes
1answer
401 views

echo: write error: Operation not permitted

Running as root user yet I'm still not permitted to use this: echo "21" > /sys/class/gpio/export echo "out" > /sys/class/gpio/gpio21/direction echo "0" > /sys/class/gpio/gpio21/value
1
vote
1answer
93 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 ...
1
vote
1answer
697 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: ...
3
votes
1answer
385 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
190 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
219 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
219 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
113 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
184 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
2answers
327 views

To Access the gpios from webpage by executing python code

I'm a student in electronics department doing a project on home automation using Raspberry Pi (for bulbs, fan, temperature and camera). I want to access the GPIO pins from a web interface to execute ...
0
votes
1answer
71 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
143 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?
11
votes
1answer
11k 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
244 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
174 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
206 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
317 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
194 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
379 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
140 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
152 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
383 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 ...