mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2026-02-01 14:16:45 +00:00
Add some circuit diagrams and update docs
This commit is contained in:
@@ -14,7 +14,12 @@ A physical push button or switch.
|
||||
|
||||
### Wiring
|
||||
|
||||
...
|
||||
Connect one side of the button to a ground pin, and the other to any GPIO pin:
|
||||
|
||||

|
||||
|
||||
*Alternatively, connect to 3V3 and to a GPIO, and set `pull_up` to `False` when
|
||||
you create your `Button` object.*
|
||||
|
||||
### Code
|
||||
|
||||
@@ -62,7 +67,10 @@ A PIR (Passive Infra-Red) motion sensor.
|
||||
|
||||
### Wiring
|
||||
|
||||
...
|
||||
Connect the pin labelled `VCC` to a 5V pin; connect the one labelled `GND` to
|
||||
a ground pin; and connect the one labelled `OUT` to any GPIO pin:
|
||||
|
||||

|
||||
|
||||
### Code
|
||||
|
||||
@@ -76,7 +84,7 @@ Create a `MotionSensor` object by passing in the pin number the sensor is
|
||||
connected to:
|
||||
|
||||
```python
|
||||
pir = MotionSensor(3)
|
||||
pir = MotionSensor(4)
|
||||
```
|
||||
|
||||
### Methods
|
||||
|
||||
Reference in New Issue
Block a user