adafruit_guvx_i2c

Python drivers for the GUVA-C32SM and GUVB-C31SM I2C UV sensors

  • Author(s): ladyada

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_guvx_i2c.GUVA_C32SM(i2c_bus: I2C, address: int = 57)

Driver for the GUVA-C32SM sensor

Note: untested!

property range: int

1, 2, 4, 8, 16, 32, 64, or 128 times

Type:

UVB range, can be

property uv_index: float

Calculated using offset and b-scale

property uva: int

The raw UV A 16-bit data

class adafruit_guvx_i2c.GUVB_C31SM(i2c_bus: I2C, address: int = 57)

Driver for the GUVB-C31SM sensor

property range: int

1, 2, 4, 8, 16, 32, 64, or 128 times

Type:

UVB range, can be

property uv_index: float

Calculated using offset and b-scale

property uvb: int

The raw UV B 16-bit data

class adafruit_guvx_i2c.GUVX_I2C(i2c_bus: I2C, address: int = 57)

Base driver for the GUVA or GUVB I2C UV light sensor.

Parameters:
  • i2c_bus (I2C) – The I2C bus the GUVX is connected to.

  • address (int) – The I2C device address. Defaults to 0x39

property measure_period: int

One of four measuring periods in milliseconds:

100, 200, 400 or 800ms

property power_mode: int

One of four power modes available:

GUVXI2C_PMODE_NORMAL, GUVXI2C_PMODE_LOWPOWER, GUVXI2C_PMODE_AUTOSHUT, or GUVXI2C_PMODE_SHUTDOWN

reset() None

Perform a soft reset

property sleep_duration: int

Sleep duration in low power mode, can be:

2, 4, 8, 16, 32, 64, 128, or 256 times

property uv_mode: bool

Whether or not UV-reading mode is enabled