mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-12-08 20:39:01 +00:00
Remove incomplete TemperatureSensor for 1.0 release, close #93
This commit is contained in:
@@ -34,7 +34,7 @@ colour LEDs, robotics kits and more.
|
||||
First, install the dependencies:
|
||||
|
||||
```python
|
||||
sudo apt-get install python-pip python3-pip python-w1thermsensor python3-w1thermsensor python-spidev python3-spidev
|
||||
sudo apt-get install python-pip python3-pip python-spidev python3-spidev
|
||||
```
|
||||
|
||||
Install with pip:
|
||||
|
||||
@@ -175,42 +175,6 @@ LightSensor(pin=None, queue_len=5, charge_time_limit=10,
|
||||
| `when_light` | A reference to the function to be called when light is detected. | `None` or Function |
|
||||
| `when_dark` | A reference to the function to be called when darkness is detected. | `None` or Function |
|
||||
|
||||
## Temperature Sensor
|
||||
|
||||
One-wire Digital Temperature Sensor.
|
||||
|
||||
### Wiring
|
||||
|
||||
...
|
||||
|
||||
### Code
|
||||
|
||||
Ensure the `TemperatureSensor` class is imported at the top of the file:
|
||||
|
||||
```python
|
||||
from gpiozero import TemperatureSensor
|
||||
```
|
||||
|
||||
Create a `TemperatureSensor` object:
|
||||
|
||||
```python
|
||||
temp = TemperatureSensor()
|
||||
```
|
||||
|
||||
#### Initialisation options
|
||||
|
||||
...
|
||||
|
||||
#### Methods
|
||||
|
||||
...
|
||||
|
||||
#### Properties
|
||||
|
||||
| Property | Description | Type |
|
||||
| -------- | ----------- | ---- |
|
||||
| `value` | The current temperature reading in degrees Celsius. | Float |
|
||||
|
||||
## MCP3008 Analogue-to-Digital Converter
|
||||
|
||||
MCP3008 ADC (Analogue-to-Digital converter).
|
||||
|
||||
@@ -165,19 +165,20 @@ attached to:
|
||||
my_button = Button(2)
|
||||
```
|
||||
|
||||
Some classes require no arguments due to the nature of the device:
|
||||
Some classes have multiple arguments, usually with some being optional. When
|
||||
arguments are optional, common default values are used. The following example:
|
||||
|
||||
```python
|
||||
temp = TemperatureSensor()
|
||||
my_button = Button(2)
|
||||
```
|
||||
|
||||
Others have multiple arguments, usually with some being optional:
|
||||
is equivalent to:
|
||||
|
||||
```python
|
||||
temp = TemperatureSensor()
|
||||
my_button = Button(2, True)
|
||||
```
|
||||
|
||||
When arguments are optional, common default values are used.
|
||||
because the second argument defaults to `True`.
|
||||
|
||||
Arguments can be given unnamed, as long as they are in order:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user