Code: Select all
import RPi.GPIO as gpio import time gpio.setmode(gpio.BOARD) gpio.setup(7, gpio.OUT) gpio.output(7, True) time.sleep(15) gpio.cleanup()
It could be that Pin 7 (GPIO4) has been configured for use with 1-wire bus devices and that driver is taking over from your code.
GPIO pins are directly connected to the Broadcom SoC and can't directly power a motor. They can only supply a small amount of current. You must use a transistor or a motor driver to run your motors. Pin 1 + 17 works because they're the 3.3V supply pins.
Correct guess, applicable to all Pis.
_o_ wrote: ↑Sun Jun 14, 2020 4:24 pmAs I was describing in my first post, I don't use any wires, I was simply using a multimiter to check the voltage when the pin is on
I checked the pin 7 with the red wire of the multimeter using pin 39 as GND.
Then, just to be sure, I opened all the GPIO that can be used to check them with the multimeter and ... magically ... all of them started to work.
I then did another test:
I used a standard 1.5 to 6V
dc motor to check again, strangely if I use the pin 1 (3.3v) and 39(GND) it works, while it doesn't work with pin 40 and 39.
Then I changed dc motor with a tiny one you can find in a small helicopter toy and it works with the pins 40 and 39.
My guess is that the GPIO for the pins like 7,11,38,40 can't provide enough power to make a small dc motor run, while the pin 1,17 can.
I was wondering, is it something that happens only to my Raspberry Pi?
Thank you for your support.