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
0answers
5 views

GPIO=webiopi.GPIO, attribute error : module object has no attribute 'GPIO'

import webiopi import math GPIO = webiopi.GPIO # Left motor GPIOs L1=4 L2=17 # Right motor GPIOs R1=19 R2=21 def left_stop(): GPIO.output(L1, GPIO.LOW) GPIO.output(L2, GPIO.LOW) def ...
0
votes
0answers
23 views

R-Pi B+ PWM pulse outputted counter

I am relatively new to using R-Pis I have a question with counting number of pulses. The task that I have is counting the number of pulses that the R-Pi is outputting. I am using the .PWM function. ...
0
votes
2answers
34 views

Driving a 4 digit 7 segment common cathode from GPIO

I have 8 330 ohm resistors wired up to 8 gpio pins (8 anodes), then I have the 4 cathodes wired to 4 other gpio pins. I tested all my connections with a multimeter and everything looks good. Then when ...
0
votes
1answer
18 views

Wiegand GPIO read not working all the time. Works most times but hangs on some reads

I'm extremely new to Python, I've been learning a bit over the last couple weeks. This is what I've managed to come up with. I'm pretty over the moon the code works most of the time but it doesnt work ...
3
votes
1answer
543 views

I need to control 8 LED's but I can only control 3? [helpful pictures attached]

I'm very new to electronics in general, but I want to build a small project where I can individually control (from a GPIO pin) 8 LED's. From what I understand, each GPIO pin on the Pi (Pi2 model B ...
1
vote
1answer
95 views

GPIO True and False seem to be reversed

I'm using the GPIO pins on my Pi under Raspian to control a relay and a computer fan. In Python 2, the command GPIO.setup (18, GPIO.OUT) Immediately supplies power to the pin and triggers the ...
0
votes
1answer
34 views

Issue with reading GPIO pin with GPIO.IN

In one of scripts we are sending HIGH to pin 17, import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(17, GPIO.OUT) GPIO.output(17,GPIO.HIGH) And in another script reading GPIO as, import ...
1
vote
4answers
100 views

How to connect a graphic card to Raspberry pi?

I want a way to connect a graphic card like nvidia or amd to raspberry pi do you think has a way to do that?
1
vote
1answer
38 views

GPIO Callbacks and How to Use Them

I'm building a prototype lift shaft, as many of you may know. And I was wondering what the best GPIO callback is, and how to use it. I've tried RPIO, bu I couldn't download it. And I've heard of ...
1
vote
1answer
38 views

Allow sudo only to run one Python script that accesses GPIO

I have a simple Python script that controls three LEDs. I want to limit the sudo command for my user counter (member of group pimem) to just run this script and because it access the GPIOs also allow ...
-1
votes
2answers
36 views

RPIO Module installation

I've been trying to install the RPIO module onto my pi. so far, no luck because my pi is without internet at the moment (I only have internet on my laptop through mobile tethering). Does anybody know ...
1
vote
1answer
34 views

Switching a Circuit on/off with a MOSFET

I have have a simple circuit that I want to drive with a raspberry pi GPIO pin and I want to use a MOSFET to control the circuit. My circuit will be using about 3-5v and 2-3a. I'm planning on using ...
0
votes
1answer
45 views

Sensors With Raspberry pi Model 2

Can i connect any Sensor with raspberry pi? For example, I have a water flow sensor like this one, and an ultrasonic sensor like this one. Is it possible to connect it to a Raspberry Pi? Or I'll need ...
1
vote
0answers
45 views

Can't open pwm pin

I know there are many questions about using pwm pins in RPi, but nothing helpfull for me. Here is my code with described error: #include "pch.h" #include "MainPage.xaml.h" using namespace ...
1
vote
1answer
36 views

Raspberry Pi IR Sensor stays HIGH when it shouldn't

I have a Raspberry Pi that has an IR sensor on it, and a Arduino that has IR LEDs hooked up to it. I am sensing when something is put into a box, but not when the item is taken out (callChris() is ...
3
votes
2answers
57 views

USB Rx from GPIO

I'm trying to get Rx from USB via GPIO for reverse engineering. I'll use it for such as keyboard, mouse, USB fax modem etc... I want to get data from USB device and sending data to my another ...
0
votes
0answers
22 views

WebIOPi: can only manage some of the GPIO

I have a Pi B Rev 2 (not a B+) and I can manage the GPIO (IN/OUT HIGH/LOW) using a Python script (GPIO.setup() and GPIO.output()) I've tried using webIOPi and I can change GPIO 17,18.22,23&24 (IN ...
1
vote
0answers
45 views

Problem with ESC, brushless motor and Raspberry Pi

I have connected an ESC (an electronic speed control) with a battery and a brushless motor. The Raspberry is connected to the ESC to control it. I know - when I turn on the program that is on the ...
0
votes
1answer
52 views

Is there documentation for RPi.GPIO

Is there documentation for RPi.GPIO? I have searched the web and can't find anything. I know I can use pydoc or help() but this produces the following:- wait_for_edge(...) Wait for an edge. ...
4
votes
3answers
43 views

convert a pic to bit stream and write it to gpio

I am new to the Raspberry Pi and i would appreciate it if you could help me to get started. I need to build a serial communication system, and the first stage is to be able to take a file (lets say a ...
1
vote
1answer
73 views

Problem using Buttons to swich LED's on and off

Im making a prototype of a model lift shaft. The LEDs in this example will eventually be replaced with relays. Side Note For those who do not know, a limit switch is a microswitch plces at the ...
0
votes
0answers
17 views

Physical computing

Have tried the physical computing instructions for programming using both scratch and python. But both are not working I have literally followed all instructions even down to if there is a line ...
0
votes
1answer
63 views

Raspberry Pi B+ (LCD-display 16x2)

I'm new to Raspberry Pi and I'm trying to get a hang of the GPIO and all that. I bought a LCD-display 16x2 with 4 buttons (http://tinyurl.com/p4kjc3z). I bought this one because it fits the first ...
2
votes
2answers
67 views

GPIO Display an Buttons dont work

i bought a pi 2 B last week with a ready to use 16x2 Display + Keyboard wich i pluged in the gpio pins. It looks exactly like this picture: When i start the pi, the background display lights up like ...
0
votes
1answer
93 views

12v+ on Raspberry Pi Ground Pin

I am currently working on a project that requires a 12V RGB led strip controller. basically this is the controller: Please note that I am using a raspberry pi 2 and that the pins in this diagram ...
0
votes
1answer
105 views

Webserver & GPIO python script (No access to /dev/mem. Try running as root!)

I am using Linux on the Pi, in-which I installed Apache, Python, and mod_python for integrating python with Apache. After running server it can run simple hello world program But after writing ...
0
votes
3answers
185 views

Driving a Sainsmart Relay using Raspberry Pi

I am actually a software engineer and not really familiar with wiring. I've been playing around with a Raspberry Pi Model B, and am looking to hook up a 2 PRONG Extension Cable to a Sainsmart 8 ...
0
votes
0answers
28 views

Fully Bit-Banged SPI

I would like to be able to run SPI over whatever GPIO pins are available on my Pi (2 and Zero mainly). Is there any decent full code example for SPI Read/Write using RPi.GPIO on arbitrary pins? Speed ...
0
votes
1answer
83 views

RPi.GPIO not working

I was trying to light an LED using RPi.GPIO on my Raspberry Pi 2 and it's not working. I'm able to do the same using pi4j library in Java. Following is the Java code which I have used to light LED. ...
0
votes
1answer
42 views

Saving a file at root

Is it possible to create/save a python script in the root folder, if so, how? The reason I ask this is because I am trying to use a single GPIO LED with python but when I run the script it gives an ...
1
vote
2answers
93 views

I Cannot Change the State of the GPIO Pins

I got a RPi 2 model B v1.1 a while ago, and I am having way too much trouble trying to change the states of the GPIO pins. I have tried RPi.GPIO with a simple Python script and WiringPi in the command ...
2
votes
1answer
75 views

Read GPIO.output to make something happen in PyGame

I'm stuck :-) I've build a simple program with pygame. I have a rectangle (pygame.draw.rect(screen, state_color1 , ( 50, 450, 150, 5)) that changes color when it's pressed. Changing the state_color1. ...
0
votes
0answers
76 views

rpi.gpio error regarding GPIO.setmode(GPIO.BOARD)

python keeps throwing this error: Traceback (most recent call last): File "power.py", line 6, in <module> GPIO.setmode(GPIO.BOARD) AttributeError: 'module' object has no attribute ...
0
votes
0answers
15 views

Arm ESC through code [duplicate]

How can I arm an ESC through code. I have tried pulsing high and low and using arduino, however none of them seem to work. I am trying to do it in python with RPi.GPIO.
0
votes
0answers
15 views

disable Prints on RPIO.PWM.Servo() [duplicate]

Hi I'm making a raspberry pi based drone coding on python , and running the motors with RPIO.PWM , everything runs fine , but when I modify the servo speed , it prints out a message ...
1
vote
2answers
103 views

GPIO cleanup via terminal

Is there any way to handle the equivalent of Python's GPIO.cleanup() via the terminal ?
2
votes
2answers
107 views

GPIO High Low not switching in Python

I run my python script below using: sudo python3 /path/to/file.py open or sudo python3 /path/to/file.py holdopen. These are supposed to cause a change in GPIO Pin 2 from high to low. For some reason ...
0
votes
0answers
32 views

How to calculate the time between 8-bit input and 8 bit output of GPIO ports?

I have written a python code which gives 8-bit input to FPGA and gets 8 bit output from it. So for giving input my code is: for k, v in sorted(dict_in.items()): # where 'k' represent ports and 'v' ...
3
votes
1answer
122 views

RPi.GPIO mysteriously crashing when setting up pin

I'm trying to test the following simple "blink" RPi.GPIO Python script. import RPi.GPIO as GPIO LED_PIN = 18 # GPIO 18, (P1 pin 12) print 'A' GPIO.setmode(GPIO.BCM) # Broadcom pin-numbering scheme ...
2
votes
2answers
803 views

Global name GPIO is not defined errors on WebIOPi

I have Raspberry Pi 2 Model B v1.1 (NOOBS v1.4.2 Raspbian loaded), and I installed WebIOPi 0.7.1 to use it in order to blink a LED on attached to GPIO24 and GND by WebIOPi page. While I tried to use ...
1
vote
1answer
83 views

Count Pulses Width on RPi-GPIO

I have a Coin Acceptor, that sends a 30ms pulse when the coin was dropped. So I tried to use many codes, but I search in the net and I think the way is use PWM to read the pulse. But this doesnt work: ...
1
vote
0answers
207 views

Image Processing With Windows IoT Core

I am a Newbie to Raspberry Pi Windows IoT core, I wanted to create a system to detect total number of Chairs/Tables present in a room for business, I researched a lot, I had a few sites stating that I ...
0
votes
1answer
175 views

Coin Counter in Raspberry Pi

I'm having a problem to count coins in raspberry usin RPi-GPIO. This is the code: import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(23, GPIO.IN) while True: print(GPIO.input(23)) ...
0
votes
0answers
39 views

Problem with GPIO of Raspberry pi long run (i.e) running for more than 2 hrs

I am using Raspberry pi 2 with Rasbian OS,I have created a python script using Tkinter , which is a button widget and using the button to switch ON the LED .But soon after 2 hours of led ON, the led ...
0
votes
2answers
99 views

Python GPIO buttons blocking Lirc

I wanted to create a remote for a small tvscreen using Lirc and python. After booting I'm able to send commands from CLI (irsend) and it works. However when I start a Python scripts to read button ...
1
vote
2answers
45 views

Arm ESC RPi.GPIO

I am trying to run a brushless motor with an esc. I know that it is supposed be pulled from 1-2ms to run. I have read online that it needs to be armed first but I don't know how to arm it. I looked ...
0
votes
1answer
83 views

Python GPIO not reading inputs

Using a very simple input script to read a button press, Python GPIO isn't reading high when the button is pressed. The wiring is correct - I have checked it using wiringpi readall. Rpi. GPIO has ...
1
vote
0answers
69 views

Run brushless motor with esc

I have looked all over the internet on how to run a brushless motor with an esc through RPi.GPIO and have no results. I have tried simply wiring the esc as it is supposed to be and programming it ...
2
votes
1answer
66 views

Getting UU when trying to read from SPI on Pi

I am trying to read digital input using the spi interface on the raspberry pi. Can someone explain why I am getting this UU? I am following this tutorial. I tried troubleshooting (shown below) based ...
0
votes
1answer
114 views

Help with a python script using pull up resistors and long presses of momentary switches

What I'm trying to achieve is to use GPIO pin 5 (BCM) on my raspberry pi b+ to receive input from a momentary switch and in response take specified actions. The actions will differ based on how long ...