other examples
This commit is contained in:
parent
62b5c34b56
commit
5426a1107f
8
1_LED/LED_pulse.py
Normal file
8
1_LED/LED_pulse.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
from gpiozero import PWMLED
|
||||||
|
from signal import pause
|
||||||
|
|
||||||
|
led = PWMLED(18)
|
||||||
|
|
||||||
|
led.pulse()
|
||||||
|
|
||||||
|
pause()
|
9
2_BUTTON/button_press.py
Normal file
9
2_BUTTON/button_press.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
from gpiozero import Button
|
||||||
|
|
||||||
|
button = Button(23)
|
||||||
|
|
||||||
|
while True:
|
||||||
|
if button.is_pressed:
|
||||||
|
print("Button is pressed")
|
||||||
|
else:
|
||||||
|
print("Button is not pressed")
|
Loading…
x
Reference in New Issue
Block a user