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 ...
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.
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.
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
Info: Adds support for software i2c controller on gpio pins
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.
An easier approach might be to use the gpiozero software. gpiozero is supported by the ...
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
GPIO.setup(4, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
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 ...
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 ...
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)?
Use two separate 5V regulated power supplies, one for Rpi, another for external circuit such ...
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 ...
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:
print("The door has been opened!")
print("The door has been closed!")
#When one ...
As far as I am aware it should work provided you download and install the latest version of wiringPi.
sudo dpkg -i wiringpi-latest.deb
Can I use my Rpi's GPIO pin to power a laser pointer?
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.
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) 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 (...
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