ADC Unit
Support the following products:
Micropython Example:
import os, sys, io
import M5
from M5 import *
import time
from unit import *
adc_0 = None
def setup():
global adc_0
print(adc_0.get_voltage())
time.sleep(1)
UIFLOW2 Example:
class ADCUnit
Constructors
- class ADCUnit(i2c0)
Create an ADCUnit object.
- parameters is:
I2C0
is I2C Port.
UIFLOW2:
Methods
- ADCUnit.get_value()
Gets the original value read by the adc.
UIFLOW2:
- ADCUnit.get_voltage()
Get the voltage value.
UIFLOW2:
- ADCUnit.get_raw_value()
Read the raw value.
UIFLOW2:
- ADCUnit.get_operating_mode()
Get working mode. (Single read or continuous read)
UIFLOW2:
- ADCUnit.get_data_rate()
Get the read rate of the data.
UIFLOW2:
- ADCUnit.get_gain()
Get the gain multiple of the data.
UIFLOW2:
- ADCUnit.operating_mode()
Set working mode (single read or continuous read)
UIFLOW2:
- ADCUnit.data_rate()
Set the data acquisition rate.
UIFLOW2:
- ADCUnit.gain()
Set the gain multiple for reading data.
UIFLOW2: