I hope someone can help with this, i've looked at similar Q&A's but haven't found an answer that solves the basic question.
Right, trying to give all the info...
I'm using a first generation B+ board, recently updated using sudo apt dist-upgrade and trying to simply get a LED to light when a button is pressed and not before. Python 3 and Thonny.
import RPi.GPIO as GPIO import time GPIO.setmode (GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(18,GPIO.OUT) GPIO.output(18,GPIO.HIGH) time.sleep(5) Print ("Done") GPIO.cleanup()
The issue is that the LED lights on GPIO.setup line, not the GPIO.output high line where I would expect it to be. I went back to basics and tried just code for the LED as above with the same result.
Any help greatly appreciated.