See RPi.GPIO documentation.
At the end any program, it is good practice to clean up any resources
you might have used. This is no different with RPi.GPIO. By returning
all channels you have used back to inputs with no pull up/down, you
can avoid accidental damage to your RPi by shorting out the pins. Note
that this will only clean up GPIO channels ...
Probably found an answer thanks to @joan 's answer.
It seems like RPi.PWM can only do software PWM, but the fan requires hardware PWM to run as smooth as possible. To do hardware PWM on any GPIO pin, the pigpio daemon has to be executed, and controlled by Python. Therefore, pigpio has to be installed first and configured to be started on boot (systemd). ...
I would look to use the gpiozero module as that’s more powerful but saying that the cleanup function is designed to reset all pins as it’s the last thing you should do in your program NOT part way through.
Also the setting of the pin mode should only be executed once in your program.
Normally, you would ‘reset’ the output by putting a high or low voltage ...
No, the GPIO pins can not be used to drive a DC motor.
They can only supply a few milliamps of current at 3V3 which will not be enough. In addition driving any inductive load direct from a GPIO is likely to destroy the GPIO and the Pi. An inductive load is such as a DC motor or a relay coil.
You need a motor driver board or chip or discrete components (e.g. ...
"Reference voltage"... do you mean supply voltage?
The answer to your question is: "Yes - you can probably use RPi's 3.3V & 5V supples to power your level shifter.".
The caveat was added because you didn't specify a particular device, and there are many devices called "level shifters".
Both the 3.3V and 5V regulators on the RPi have some "excess" ...