Hot answers tagged

3

Based upon this discussion regarding interrupts, it would appear to be very possible to handle something that is 0.1-0.5 kbps. As with many things on this platform, there are many potential ways to make this happen. From the simplest to the most complex, one could do this with pigpio or one could code a kernel module to function as an interrupt service ...


3

Solution: Add: dtoverlay=gpio-no-irq to /boot/config.txt. Previously the kernel would automatically disable interrupts when you set one of rising/falling edge detection methods but that apparently stopped happening, causing a kernel panic. See this post for more details.


2

The answer to your question is - it depends. With the circuit you have drawn it will be OK. If the output is HIGH no current will flow; If the output is LOW 3.3/5 ~ 660µA will flow into the GPIO, which is well within its specifications.


2

You can use any spare pair of GPIO to create a software I2C bus. As you have noted you will need to use external pull-ups to 3V3 on the chosen GPIO. You need to add an entry to /boot/config.txt For details see /boot/overlays/README Name: i2c-gpio Info: Adds support for software i2c controller on gpio pins Load: dtoverlay=i2c-gpio,<param>=<...


2

A5 to A0 should be thought of as a binary number. Ax is 1 if there is a solder bridge, otherwise 0. A5 A4 A3 A2 A1 A0 Decimal 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 2 0 0 0 0 1 1 3 0 0 0 1 0 0 4 0 0 0 1 0 1 5 0 0 0 1 1 0 6 0 0 0 1 1 1 7 0 0 1 0 0 0 8 ... 1 1 0 1 0 1 53 1 1 0 1 1 0 ...


2

My pigpio library lets you control the GPIO of one or more Pis from another machine on the network. The other machine may be a Windows, Linux, Mac, or Android machine. It's simplest if the other machine can run Python. http://abyz.me.uk/rpi/pigpio/python.html An easier approach might be to use the gpiozero software. gpiozero is supported by the ...


2

You're not actually re-checking GPIO4, you're just re-reading the variable mag1. One way to fix this would be to add mag1=GPIO.input(4) after your time.sleep(20). import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(18,GPIO.OUT) GPIO.setup(4, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) mag1=GPIO.input(4) if mag1: ...


2

I'm going to post this as an answer because I had a lot of trouble researching how to drive an ESC with just a Rasp Pi(using a zero w) and it works now, Hopefully someone having the trouble finding out how will see this: Joan was completely right with the 1000 low and 2000 ms high pulse width. I ran the GPIO pins at 50 hz. Here is some light arithmetic ...


2

The voltage will fluctuate slightly on the 5v pin due to the protection circuitry built-in to the Raspberry Pi. Mainly the polyfuse, which has a resistance of about 0.2 ohms. When the load increases (LEDs, CPU usage, hard drive spinning), the voltage will drop slightly on the GPIO 5v pin. If that voltage drop is undesirable, you can: Run the chip on a ...


2

Question How to keep (1) 5V DC power supply for Rpi and (2) 5V DC power supply for external circuits, eg, LEDs, relays etc as steady as possible, say, less than 0.02V fluctuation (ie, "slight dip" in Rpi 40 pin connector 5V power, when switching on LEDs)? Solution Use two separate 5V regulated power supplies, one for Rpi, another for external circuit such ...


2

The official design specification for a Raspberry Pi HAT hasn't changed since 2014 when the current form-factor was launched with the RPiB+. There's no hardware reason why a HAT for a RPi2B won't run on a RPi4B. The thing that may need to change is the software driver as 32-bit Buster is a bit different to Jessie. The RPF/RP(T)Ltd. folks have just launched ...


1

This is likely to be a feature of RPi.GPIO. I would not try to fight it. Perhaps change to something like the following. ... STATUS = False #When a door event occour: def door(channel): global STATUS if STATUS: if GPIO.input(23): print("The door has been opened!") else: print("The door has been closed!") #When one ...


1

As far as I am aware it should work provided you download and install the latest version of wiringPi. http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b/ cd /tmp wget https://project-downloads.drogon.net/wiringpi-latest.deb sudo dpkg -i wiringpi-latest.deb


1

Question Can I use my Rpi's GPIO pin to power a laser pointer? Answer Well, try it or fry it. Your cheap one dollar ”high power“ laser pointer should have a spec of 5mW. Now let us find the current draw. Your may find hobbyists measuring current to be in the range of < 50 mA. But you might also read advert with spec of current draw > 300 mA. ...


1

A Pi GPIO can safely supply about 16 mA at 3.3V. If the laser you are using needs 16 mA or less you should be fine. If the laser needs more than 16 mA but less than 50 mA you could use two or three GPIO to power the device.


1

Question Experiment (1) Rpi4B terminal command Gpio and Python GpioZero can set GPIO pin output High or Low level. (2) GPIO pin if connected to a (push button or toggle) switch can set Gpio pin output to Low. (3) If switch in (2) is disconnected, GPIO pin output goes High level again. (4) If GPIO pin connected to Rpi 40 pin connector's 5V power output (...


1

To enable 1-wire (with or without parasitic power) you need dtoverlay=w1-gpio dtoverlay=w1-gpio-pullup in /boot/config.txt


1

GPIO 14/15 may be used to provide a system console. GPIO 14 (connected to pin 8) has console output during boot. GPIO 15 (connected to pin 10) is used for console input. You can use raspi-config in Raspbian to disable this behaviour. Interfacing Options -> Serial -> Would you like a login shell to be accessible over serial? No https://pinout.xyz/


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