Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 1225

Python • Re: Raspberry Pi 5 GPIO busy

$
0
0
Can you put you pieces of code in between [code][/code] tags?

That makes the difference between:

from gpiozero import Button
from time import sleep

button = Button(2)

button.wait_for_press()
print('Button pushed')

And

Code:

from gpiozero import Buttonfrom time import sleepbutton = Button(2)button.wait_for_press()print('Button pushed')
which preserves the indentation. The same is true for logs and config files.

Statistics: Posted by DougieLawson — Wed Jun 05, 2024 9:50 am



Viewing all articles
Browse latest Browse all 1225

Trending Articles