O have tried to do this so many times, so many websites, so many books, and it just won't work. I do not know how to wire it so that the LED lights up when I press the button. I'm pretty sure that I have the correct type of button, and it works when I only tell it to just light the LED, so I am so confused.
Here is one of the more recent codes I have used.
from gpiozero import LED, Button from signal import pause led = LED(18) button = Button(23) button.when_pressed = led.on button.when_released = led.off pause()
There you go, my real wiring. -_-