I have a Raspberry Pi 4B, 4GB version. When I try to run the following code it gives 0.3V output. I mean it works, on-0.3V, off-0V. But I need 3.3V output. I measured it with a voltmeter, as the interested device was not working getting only 0.3V from Pi.
import time GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(21,GPIO.OUT) print ("LED on") GPIO.output(21,True) time.sleep(10) print ("LED off") GPIO.output(21,False)