MicroPython AS6212 Library¶
as6212¶
MicroPython Library for the ASM AS6212 Temperature Sensor
Author(s): Jose D. Montoya
-
class micropython_as6212.as6212.AS6212(i2c, address: int =
0x48)[source]¶ Driver for the AS6212 Sensor connected over I2C.
- Parameters:¶
Quickstart: Importing and using the device
Here is an example of using the
AS6212class. First you will need to import the libraries to use the sensorfrom machine import Pin, I2C from micropython_as6212 import as6212Once this is done you can define your
machine.I2Cobject and define your sensor objecti2c = I2C(1, sda=Pin(2), scl=Pin(3)) as6 = as6212.AS6212(i2c)Now you have access to the attributes
temp = as6.temperature- property conversion_rate : str¶
Sensor conversion_rate The conversion rate bits define the number of executed temperature conversions per time unit. Additional readouts of the temperature register between conversions are possible but not recommended because the value is changed only after a conversion is finished
Mode
Value
as6212.RATE_0_250b00as6212.RATE_10b01as6212.RATE_40b10as6212.RATE_80b11
- property interrupt_mode : str¶
Sensor interrupt_mode
Mode
Value
as6212.COMPARATOR0b0as6212.INTERRUPT0b1