MicroPython AGS02MA Driver¶
ags02ma
¶
MicroPython Driver for the AGS02MA TVOC sensor
Author(s): ladyada, Jose D. Montoya
ags02ma
¶
MicroPython Driver for the AGS02MA TVOC sensor
Author(s): ladyada, Jose D. Montoya
-
class micropython_ags02ma.ags02ma.AGS02MA(i2c, address: int =
0x1A
)[source]¶ Driver for the AGS02MA Sensor connected over I2C. I2C communication speed cannot be higher than 30 kHz
- Parameters:¶
- Raises:¶
RuntimeError – if the sensor is not found
Quickstart: Importing and using the device
Here is an example of using the
AGS02MA
class. First you will need to import the libraries to use the sensorfrom machine import Pin, I2C import ags02ma
Once this is done you can define your
machine.I2C
object and define your sensor objecti2c = I2C(1, sda=Pin(2), scl=Pin(3)) ags02ma = ags02ma.AGS02MA(i2c)
Now you have access to the attributes
tvoc = ags02ma.TVOC