grove.grove_air_quality_sensor_v1_3
¶
- This is the code for
Examples
import time
from grove.grove_air_quality_sensor_v1_3 import GroveAirQualitySensor
# connect to alalog pin 2(slot A2)
PIN = 2
sensor = GroveAirQualitySensor(pin)
print('Detecting ...')
while True:
value = sensor.value
if value > 100:
print("{}, High Pollution.".format(value))
else:
print("{}, Air Quality OK.".format(value))
time.sleep(.1)
Classes¶
GroveAirQualitySensor
: Grove Air Quality Sensor class
- class grove.grove_air_quality_sensor_v1_3.GroveAirQualitySensor(channel)[source]¶
Grove Air Quality Sensor class
- Parameters:
pin (int) – number of analog pin/channel the sensor connected.
Inheritance
digraph inheritancedb9434dad2 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "GroveAirQualitySensor" [URL="#grove.grove_air_quality_sensor_v1_3.GroveAirQualitySensor",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Grove Air Quality Sensor class"]; }- property value¶
Get the air quality strength value, badest value is 100.0%.
- Returns:
ratio, 0(0.0%) - 1000(100.0%)
- Return type:
(int)