maix::peripheral::adc

maix.peripheral.adc module

This is maix::peripheral::adc module of MaixCDK.
All of these elements are in namespace maix::peripheral::adc.

For MaixCDK developer: DO NOT edit this doc file manually, this doc is auto generated!

Module

No module

Enum

Variable

RES_BIT_8

8-bit resolution, supported by the actual hardware

item description
value 8
readonly True

C++ defination code:

const int RES_BIT_8 = 8

RES_BIT_10

10-bit resolution, supported by the actual hardware

item description
value 10
readonly True

C++ defination code:

const int RES_BIT_10 = 10

RES_BIT_12

12-bit resolution, supported by the actual hardware

item description
value 12
readonly True

C++ defination code:

const int RES_BIT_12 = 12

RES_BIT_16

16-bit resolution, supported by the actual hardware

item description
value 16
readonly True

C++ defination code:

const int RES_BIT_16 = 16

Function

Class

ADC

Peripheral adc class

C++ defination code:

class ADC

__init__

ADC constructor

item description
type func
param pin: direction [in], adc pin, int type
resolution: direction [in], adc resolution. default is -1, means use default resolution
option:
resolution = adc.RES_BIT_8, means 8-bit resolution
resolution = adc.RES_BIT_10, means 10-bit resolution
resolution = adc.RES_BIT_12, means 12-bit resolution
resolution = adc.RES_BIT_16, means 16-bit resolution
the default resolution is determined by actual hardware.
vref: direction [in], adc refer voltage. default is -1, means use default refer voltage.
the default vref is determined by actual hardware. range: [0.0, 10.0]
static False

C++ defination code:

ADC(int pin, int resolution, float vref = -1)

read

read adc value

item description
type func
return adc data, int type
if resolution is 8-bit, return value range is [0, 255]
if resolution is 10-bit, return value range is [0, 1023]
if resolution is 12-bit, return value range is [0, 4095]
if resolution is 16-bit, return value range is [0, 65535]
static False

C++ defination code:

int read()

read_vol

read adc voltage

item description
type func
return adc voltage, float type。the range is [0.0, vref]
static False

C++ defination code:

float read_vol()