Skip to main content
Share Your Experience: Take the 2024 Developer Survey
13 votes
Accepted

GPIO status after python code is closed

If you're using RPi.GPIO and run .cleanup() at the end of your script, it will return the channel(s) back to inputs with no pull up/down. Otherwise, they will remain in the state you left them. ...
thephez's user avatar
  • 310
5 votes

GPIO status after python code is closed

It depends on the module you are using and if you have changed the GPIO state using the module (rather than indirectly by calling a shell program to change the state). My pigpio leaves the GPIO in ...
joan's user avatar
  • 71.1k
5 votes
Accepted

How to set a GPIO pin to default HIGH before setting it to output?

As suggested by anonymoose's comment and RPi.GPIO's documentation RPi.GPIO module basics setting a pin to output allows to specify an initial value: To set up a channel as an output: GPIO.setup(...
4 votes
Accepted

How to turn off pin 23 correctly? SSH connection crashed

Assuming your SSH session is restored, otherwise reboot ... On the standard terminal command line: gpio -g mode 23 out gpio -g write 23 0 From Python: import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) ...
John Hawthorne's user avatar
4 votes
Accepted

Why is pull up resistor preferred over pull down for the matrix keypad?

In general the reason electronic engineers prefer pull-ups to pull-downs is that in silicon N type (NPN bipolar or N-channel FET) transistors are better than P type transistors (PNP bipolar or P ...
Peter Green's user avatar
  • 6,486
4 votes
Accepted

Control fan to lower temperatur via script

The following answer addresses a Hardware and Software approach, and an Easier alternative requiring only hardware & a configuration change. This project may be of interest. The author uses a ...
Seamus's user avatar
  • 22.2k
3 votes

Why is my audio (sound) output not working?

My current working hypothesis is that, for me at least, the audio depends somehow on the desktop environment. I have a Raspberry Pi 2, running Raspbian, installed from NOOBS. I've wiped it clean and ...
Daniel's user avatar
  • 31
3 votes
Accepted

I2S Recording combined with I2S Playback

I was also getting the same error. But now it is working for me. First you install I2S microphone as shown here: https://learn.adafruit.com/adafruit-i2s-mems-microphone-breakout/raspberry-pi-wiring-...
Keshava Shreenidhi Badanaje's user avatar
3 votes
Accepted

Use Pi 3 B as external memory

No, you can't. Only Raspberry Pi Zero (W) and the Compute Module support the USB gadget mode that enables the emulation of a USB mass storage device while the USB ethernet gadget seems to work best. ...
kwasmich's user avatar
  • 2,702
3 votes

No display output if I start raspberry pi and then start the monitor

I had the exact same problem. Solutions are: Turn on the screen first. I give it 4 seconds. Slower SD cards won't have this problem, since the Pi waits longer before checking for a monitor. Add/...
Botspot's user avatar
  • 1,779
2 votes

GPIO status after python code is closed

Status (input/output direction and value) will stay as set until they are changed again - unless your script explicitly messes with them (the other answers got that covered).
Ghanima's user avatar
  • 15.9k
2 votes

Why is my audio (sound) output not working?

I was having problems with the analog audio output myself. Came to this thread among others to try to solve. In the end, it turns out I only needed to right-click on the audio icon in my toolbar and ...
Alex Skarulis's user avatar
2 votes
Accepted

How do I attach two monitors in a dual head configuration?

Well, now the Raspberry Pi 4 model B has come out with two Micro HDMI ports, so I think that gives the best solution to the problem? If you don't want a Pi 4, it seems that buying two Pis may still ...
Metamorphic's user avatar
2 votes

No video on HDMI?

In config.txt comment out #dtoverlay=vc4-fkms-v3d this started my system to work. I think only one hdmi output works but I do not care. It has a problem finding which video to use and some people ...
john's user avatar
  • 21
2 votes
Accepted

Composite video out not working

I suggest this cable, it might work. Its essentially a 3.5mm to 3 x RCA. I assume if the feature worked with the B+ they would have kept it for the Pi 2 and 3. There are also reviews on the same page ...
Darth Vader's user avatar
  • 4,196
2 votes

Use PHP to get callback from GPIO in

Take a look at phpi, it allows event binding to GPIO and is written in pure PHP. There's also an example to interface realtime via WebSockets which should solve the problem nicely. Disclosure: I am ...
calcinai's user avatar
  • 179
2 votes

raspbian-output-video-camera-to-3-5-lcd

If the screen is operating from the GPIO pins (I must admit I'm not familiar with the Kookye 3.5" LCD) then the short answer is: you don't. From the picamera FAQ: 5.4. The preview doesn’t work ...
Dave Jones's user avatar
  • 3,978
2 votes
Accepted

Can I make a GPIO into a 3v output?

Yes, change the GPIO to mode OUTPUT and write 1 (high). The GPIO will then output 3V3 relative to ground. Note that the GPIO will only safely supply about 16mA. I should say that a better solution ...
joan's user avatar
  • 71.1k
2 votes
Accepted

Speeding up updating of GPIO pins

Have you looked at the source for pigpio? Or programmed a microcontroller that required you to access pins at the hardware level? I'll explain why I ask this in a few lines. If you're running this ...
NomadMaker's user avatar
  • 1,560
2 votes

GPIO ports not working

There appear to be two possibilities. something is connected to GPIO 24 and GPIO 25 which is pulling those GPIO low. The Pi is broken. I suggest you remove everything from the expansion header and ...
joan's user avatar
  • 71.1k
2 votes

Can I connect two Raspberry Pis to one 5" Display via an HDMI switch?

Yes, perfectly possible. Obviously just make sure you have easy access to the button in your enclosure. You can do that with more or less any sort of hdmi device. For example I have a ps4 connected to ...
rohtua's user avatar
  • 459
2 votes

128x64 OLED Display Issue

It turns out I was using the wrong Library. The device I have is a SH1106, not a SSD1306. When using the proper library (Like this one) It works fine.
epicdig07's user avatar
2 votes

see output from c++ program which was started by rc.local

is there a possibility to see output (f.e. std cout << ...) from my program which was started from rc.local script when i am logged into my Rpi via SSH? A process started by init (which ...
goldilocks's user avatar
  • 59.1k
2 votes

Usb sound device to 3.5mm output real time

Yes I think it is possible, for example you can use FIFO file: ~$ mkfifo /tmp/input.audio.fifo Write a python programm like this (warning, this script record only 60sec of audio, you can adjust this)...
Ephemeral's user avatar
  • 2,157
2 votes

PedalPi, lag when piping in data

In your code Output code you have not define bcm2835_spi_setClockDivider(BCM2835_SPI_CLOCK_DIVIDER_64); // 4MHz clock with _64 , you not divide the clock. Per default the clock freq. is 250MHz, so ...
Ephemeral's user avatar
  • 2,157
2 votes
Accepted

GPIO Output Pin Reverse Current/Higher Voltage

Question The OP has the following device. He would like to know how can Rpi interface this device. Question Analysis The OP is asking 4 little questions. All 4 questions are OK, except the third ...
tlfong01's user avatar
  • 4,695
2 votes

Outputting RPi video into a laptop

As you well said, you can't output HDMI video into a laptop. I don't know of any devices as of now, however, I recommend using VNCServer and Viewer. It's almost as simple as using an HDMI. Just ...
NicolleMayol's user avatar
2 votes

Is there an elegant way to play Audio on the Zero W?

Just use the data port you can connect it to a USB audio device. You could also buy a similar device to the one you put above that you could connect to the Data port. If you're tight on space search ...
aklingam's user avatar
  • 974
2 votes

Control fan to lower temperatur via script

You would need a way of switching the 5V supply on and off. The Pi GPIO are all 3V3 and can not supply enough power for a fan. The 5V pins are NOT GPIO and are not switchable (they are powered while ...
joan's user avatar
  • 71.1k
2 votes

try to set GPIO.output(x, LOW) but connected LED still lights

It is unclear exactly what you have done (list full code & connections). What is R_US The fundamental problem is your circuit. Using an emitter follower is POOR practice; it will attempt to put 2....
Milliways's user avatar
  • 60.3k

Only top scored, non community-wiki answers of a minimum length are eligible