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

0
votes
1answer
28 views

How to shutdown GPIO elegantly when using kill to stop Python script running in the background?

I'm using GPIO in a Python script, and I've wrapped my code in a try... except block so that GPIO is exited elegantly if I need to abort the script: GPIO.setup(17, GPIO.OUT) # Configure GPIO so that ...
1
vote
1answer
26 views

Problem when trying to get a DC motor to run using the L298N H-Bridge?

My setup is as follows: Using this motor controller board, I have one DC motor (I'm new to electronics, so I'm not sure when I say it's rated at 1.5V, because one 1.5V AA battery on its own makes it ...
0
votes
3answers
59 views

How to blink LEDs on/off continually, while continuing execution of a script?

I've connected red and green leds via GPIO and I can successfully switch them on/off using RPi.GPIO - now I'd like to: start an led blinking on/off every 1 second have the script continue its ...
2
votes
3answers
135 views

How to connect 7-segment 4-digits display with Pi?

I would like to connect such a 7-segment 4-digits display (with common anode) to the Raspberry Pi: What's the simplest way to do it with Python for example? Do I need the RPi.GPIO package? Is there ...
0
votes
0answers
41 views

Raspberry Pi Frequency Calculator

I'm trying to make a simple program that calculates the frequency at a pin on the board. I'm using Python for the programming. I wrote two different programs and they gave the same (wrong!) results. I ...
0
votes
2answers
22 views

How to change the default baudrate of raspberry pi's serial port?

Iam getting junk values that is being read by rpi's serial port. Rpi is reading data through its serial port from a zigbee which is connected to the ttyAMA0 of rpi. In the python program, i've ...
2
votes
1answer
85 views

How do I get Python to recognize that it is running on a Raspberry Pi

I just purchased a Pi 2, and everytime I use "Import RPi.GPIO" in Python it returns an error that says RPi.GPIO can only be run on a Raspberry Pi, but I am running it on a Pi. I tried apt-get update ...
0
votes
0answers
102 views

Different “Adafruit 16x2 Character LCD + Keypad for Raspberry Pi” Python Libraries & Sunfounder plate

I have the SunFounder I2C interface 16x2 LCD Pi Plate with KeyPad with RGB LED for Raspberry Pi plate (this model available at Amazon (sorry I have only the german link - the picture is showing the ...
0
votes
0answers
9 views

Installing PS3 controller with RPi [duplicate]

Hi I have been trying to install and work a PS3 controller with my raspberry pi. I want to use it as a joystick to control 2 motors which are speed regulated using ESCs. I have followed various ...
0
votes
2answers
61 views

What happens if I try to read an analog pin's value?

I know there is a simple circuit you can make to be able to read an analog pin but what if I don't know if my device's pin is giving me analog or digital? If I try to read from that pin anyway am I ...
0
votes
1answer
50 views

gpio get value of pin

I'm trying to get the value of a single pin from an rc receiver (receiver info at bottom). What's the correct way to read the value coming in? Here's my existing code: import RPi.GPIO as GPIO ...
-1
votes
2answers
98 views

GPIO is not working, 5V working, 3.3 V working, Raspberry Pi B+

I am the RPi B+ user. Feeling confused about the GPIO. GPIO isn't working. I tried checking it with multimeter by connecting the pin 21 to the gnd, not work. And then i tried the 5 v and 3.3 v, it ...
0
votes
1answer
95 views

HC-SR04 distance sensor doesnt work

I try to make HC-SR04 distance sensor on my rasp pi robot but it doesnt work and I don´t know where is problem. Here is my python code. Program stop in first while loop. VCC is connect to PIN 2. ...
0
votes
1answer
57 views

Is there a way to see if a GPIO pin is on or off using the python RPi.GPIO module?

I have a relay connected to the RPi. Pin 12 for output on/off and grounded with pin 6. Currently I have two python scripts one for turning pin 12 on and another to turn it off. My goal is to run a ...
0
votes
1answer
32 views

Power a docking speaker directly from raspberry pi GPIO pins

I have a raspberry pi plugged into a small portable philips docking station and stream music to it (it's acting as a squeezebox player). At the moment I am running to power supplies, a 9V 2amp for the ...
1
vote
1answer
48 views

Re- Wire a DAC for newer GPIO pin layout

I have a Hifiberry DAC for a model B and would like to use it on b+ or pi 2. I know the GPIO pins have changed from model B layout - would it be possible to figure out the old and new layout ...
2
votes
1answer
97 views

Write floats to gpio

I want to control an LED Strip via the gpio PIns of my Raspberry pi 2. I found some ways for example using Python or WiringPi. But I need to use "non absolute values" like "put Pin 0 to 0.2 and Pin 2 ...
1
vote
1answer
55 views

problem with LED matrix setup with raspberry pi model B+

I have a raspberry pi model B+ , and an 8x8 LED matrix(single colored) , so I connected 8 GPIO pins to the 8 row pins of the matrix and another 8 GPIO pins to the 8 colomn pins. Note that I am pretty ...
3
votes
1answer
104 views

Simulate GPIO pins

I would like to do some simulation of the Raspberry's GPIO pins, e.g. for automated testing and developing the scripts on another host that is not the RPi. Are there any existing ...
2
votes
2answers
261 views

/sys/devices/virtual/gpio dissapears after installing RPi.GPIO on Archlinux ARM

...tinkered a bit with GPIO and Piface Digital. It was all ok until I had installed RPi.GPIO via pip. After that the directory /sys/devices/virtual/gpio disappeared and never showed up again. I had it ...
0
votes
1answer
506 views

ImportError: No module named GPIO

I have install RPi.GPIO 5.3a from here: https://pypi.python.org/pypi/RPi.GPIO i ran the next code: sudo python setup.py install there are no fails on the installing. I will run the next script: ...
0
votes
1answer
42 views

Use OR Operator Between Two GPIO on python [closed]

I am writing a short program in Python on the Raspberry Pi, to stop a while loop by any of the one GPIO from two, but it is not stopping the loop. Although, if I use GPIO individually its successfully ...
4
votes
2answers
169 views

Raspberry Python Libraries

I am currently working with a Raspberry Pi (Model B+) and have some experience with Arduino (and it's derivates). Now, there are three Libs for GPIO access with Python for the Pi: WiringPi ...
1
vote
1answer
125 views

Stop while Loop by GPIO INPUT in Python [closed]

I am writing a program in python on RaspberryPi, to stop While loop through GPIO input. I don't know why it is not working. Can you please look on my coding and guide me to resolved it? import ...
0
votes
1answer
74 views

Change the GPIO pull_up_down=GPIO.PUD_UP to GPIO.PUD_DOWN?

Im working on something similar these link: Connecting a Push Switch But with few changes: LED attached and wish the LED to be high only when the switch is pressed. I tried something like ...
1
vote
2answers
72 views

what is resistance of the GPIO outputs

I am building a simple resistor / capacitor in series (RC) circuit to measure resistance with my RPi A+. RC Design This design is similar to the one used in this tutorial as suggest on this post. ...
2
votes
1answer
167 views

GPIO general use pins stuck in HIGH position

I am trying to do "LED Blink" with GPIO and Python on my RPi B+. I am using my breakout board with a breadboard and am jumping pin 11 (GPIO 17) > resistor > LED > jump to pin 9 (GND). I am using the ...
0
votes
0answers
13 views

what is the INTERRUPT_HOSTPORT?

I am understanding the interrupts in the raspberry pi B+ board and I come across this interrupt INTERRUPT_HOSTPORT And I dont know what it is for? Can u explain me once? Thanks in advance.
0
votes
1answer
95 views

GPIO Connections

I would like to use raspberry pi for measurement of Temperature,Humidity,Motion, soil moisture & distance. I would like to add three led indicators. I'll be using following sensors 1) DHT-11 ...
3
votes
1answer
106 views

Cannot use particular pin in GPIO

I am trying to blink a LED on a Raspberry Pi using GPIO 4 (P1.7). Here is my code: #include <bcm2835.h> #define PIN RPI_GPIO_P1_7 int main() { bcm2835_init(); bcm2835_gpio_fsel (PIN, ...
0
votes
1answer
44 views

How many GND does a RasPi model B rev.2 P1 header have?

I see a lot of conflicting documentation on how many GND pins are available on model B rev. 2.0. I have hardware revision "000e" and there are a lot of DNC (Do Not Connect) pins. ...
1
vote
1answer
416 views

Is it possible to use the mini UART and PL011 UART together on a rpi B+? [duplicate]

How to get more than one uart interface is a quite interesting question that I was not able to fully answer for my rPi Model B+ v.2 - the one with the extended 40pin connectors. To avoid this beeing ...
2
votes
2answers
181 views

I am getting ghosting/bouncing on my digital input

I am meassuring data pulses from my electrical meter, giving me one pulse per Watt used. I have 4 electrical meters connected to my Raspberry Pi model B. I have connected them directly like this (no ...
0
votes
1answer
146 views

i want to set the alt function for the gpio in raspberry pi

I am working on the raspberry pi, doing changes in the machine driver. And there is a hack in the machine driver to change the alt function of one gpio. So i want to remove the hack and want to call ...
5
votes
0answers
221 views

Running RPi on Solar Panel and battery [closed]

I’m quite new in electronic projects and so my basics are quite limited. I've been reading a lot regarding this topic (refer to the title) and I’m currently planning to buy the suitable Solar Panel, ...
0
votes
1answer
166 views

Enable GPCLK line for 1MHz (or greater) clock

I'm trying to drive a TLC5940 with a brand new RPi Model A+ (V1). I plan to use the Pi's SPI bus to pipe data to the chip, which I've done successfully before using an AVR. The part I'm stuck with is ...
1
vote
2answers
272 views

may connect 26 pin touchscreen display to a 40 pin raspberry pi A+?

Recently, i've got as a present a raspberry pi a+ (40 GPIO pins) and touchscreen display for older version (26 GPIO pins) I tried to google, but wherever i search it gives me description of the new A+ ...
2
votes
4answers
263 views

GPIO Pin 17 does not trigger RPi.GPIO callback

I'm trying to read from all my Raspberry Pi B+ GPIOs. Using the Python3 RPi.GPIO library, it is quite easy to do, but I've come across a problem that I can't seem to resolve : GPIO 17 does not ...
1
vote
1answer
122 views

How to get RPi to generate a triangle wave, then outputting a PWM signal

I want my Raspberry Pi B+ Model to generate a triangle wave and output a PWM signal from one of the GPIO pins, but I'm not sure how to go about doing this. All I want it to do is add some small length ...
0
votes
0answers
75 views

External power supply needed to run two stepper motors?

I am following this tutorial for a CNC laser engraver (http://funofdiy.blogspot.co.uk/2013/10/a-raspberry-pi-controlled-mini-laser.html). I have got two stepper motors from some old DVD drives and the ...
1
vote
1answer
193 views

WiringPi: Random Interrupts caused by PWM?

This program is supposed to react to rising and falling edges of an input signal. However it doesn't exactly work as expected. The expectation is that one (1) interrupt is generated for any edge, ...
0
votes
1answer
695 views

RPI B+ with connected servo is twitching

I am looking for some advice on how to properly get my servo working correctly. I have wired it up and it appears to be working correctly. The problem I have is with the signalling causing a ...
1
vote
1answer
46 views

How can i detect which board i am using through the i2c of the raspberry pi [closed]

I am working on a project where i moved from raspberry pi model B to B+. So i need to change my audio driver to work on both models by doing some GPIO changes . The requirement is, i have to find ...
0
votes
1answer
38 views

How to know which revision the rpi board belongs to using c language program

I need to do some changes in my audio card driver on the raspberry pi board. What I need to do is: I have to check which model board it is and then I have to program the GPIO's based on the revision ...
0
votes
1answer
186 views

What happened to the i2s pins which are in RPI B board and not in RPI B+ board

I'm working on RPI model B board.I've a driver for wolfson audio card,Which uses i2s pins for data transfer.Now i need to work on RPI B+ model.But there are no i2s pins in model B+.What i need to do ...
0
votes
1answer
2k views

reading pin state whether it's input or output [RPi.GPIO]

Is it possible to read pin state (1 or 0) whether it's set as output or input without setting this with RPi.GPIO.setup(pin, GPIO.IN/GPIO.OUT)? I mean i can do this via command: gpio read 2 But ...
1
vote
1answer
819 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
51 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
134 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
483 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 ...