We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 92616c4 commit 73ddd80Copy full SHA for 73ddd80
docs/examples/motion_sensor_callbacks.py
@@ -1,19 +1,16 @@
1
-from picozero import MotionSensor, LED
+from picozero import MotionSensor, pico_led
2
from time import sleep
3
4
pir = MotionSensor(2)
5
6
-# Create an LED on pin 25 (built-in LED)
7
-led = LED(25)
8
-
9
# Set up event callbacks
10
-pir.when_motion = led.on
11
-pir.when_no_motion = led.off
+pir.when_motion = pico_led.on
+pir.when_no_motion = pico_led.off
12
13
# Keep the program running
14
try:
15
while True:
16
sleep(1)
17
except KeyboardInterrupt:
18
print("\nShutting down...")
19
- led.off() # Make sure LED is off when exiting
+ pico_led.off() # Make sure LED is off when exiting
0 commit comments