Answers for "rpi use gpio python"

0

rpi use gpio python

from gpiozero import LED, Button

led = LED(17)
button = Button(2)

while True:
    if button.is_pressed:
        led.on()
    else:
        led.off()
Posted by: Guest on February-20-2021

Python Answers by Framework

Browse Popular Code Answers by Language