ADC - Voltage Collection

This class collects voltage signals.

Constructor

misc.ADC

class misc.ADC()

Example:

from misc import ADC
adc = ADC()

Methods

ADC.open

ADC.open()

This method initializes ADC.

Return Value:

0 - Successful execution

-1 - Failed execution

ADC.read

ADC.read(ADCn)

This method reads voltage values of a specified channel. Unit: mV .

Parameter:

Return Value:

If successful, a specified channel voltage value is returned.

-1 - Failed execution.

Example:

>>>adc.read(ADC.ADC0)  # Reads voltage value of ADC0
613
>>>adc.read(ADC.ADC1)  # Reads voltage value of ADC1
605

Mapping Relationship Between ADC Passages and Pysical Pins:

ADC number Pin correspondence
ADC0 Pin number19
ADC1 Pin number20
ADC number Pin correspondence
ADC0 Pin number9
ADC number Pin correspondence
ADC0 Pin number19
ADC1 Pin number20
ADC2 Pin number113
ADC3 Pin number114
ADC number Pin correspondence
ADC0 Pin number45
ADC1 Pin number44
ADC2 Pin number43
ADC number Pin correspondence
ADC0 Pin number45
ADC1 Pin number44
ADC number Pin correspondence
ADC0 Pin number45
ADC1 Pin number44
ADC number Pin correspondence
ADC0 Pin number24
ADC number Pin correspondence
ADC0 Pin number24
ADC1 Pin number2
ADC number Pin correspondence
ADC0 Pin number9
ADC1 Pin number96
ADC number Pin correspondence
ADC0 Pin number9
ADC1 Pin number96
ADC number Pin correspondence
ADC0 Pin number24
ADC1 Pin number2
ADC number Pin correspondence
ADC0 Pin number19
ADC1 Pin number20
ADC number Pin correspondence
ADC0 Pin number9
ADC1 Pin number96
ADC number Pin correspondence
ADC0 Pin number19
ADC1 Pin number20
ADC2 Pin number113
ADC3 Pin number114
ADC number Pin correspondence
ADC0 Pin number9
ADC1 Pin number96
ADC number Pin correspondence
ADC0 Pin number24
ADC1 Pin number2
ADC number Pin correspondence
ADC0 Pin number19
ADC1 Pin number20
ADC number Pin correspondence
ADC0 Pin number9
ADC1 Pin number96
ADC number Pin correspondence
ADC0 Pin number9
ADC1 Pin number96
ADC number Pin correspondence
ADC0 Pin number8
ADC1 Pin number7
ADC2 Pin number6
ADC number Pin correspondence
ADC0 Pin number2
ADC number Pin correspondence
ADC0 Pin number2
ADC number Pin correspondence
ADC0 Pin number24
ADC1 Pin number2
ADC number Pin correspondence
ADC0 Pin number9
ADC1 Pin number96

ADC.close

ADC.close()

Return Value:

0 - Successful execution

-1 - Failed execution

Constants

Constant Description
ADC.ADC0 ADC channel 0
ADC.ADC1 ADC channel 1
ADC.ADC2 ADC channel 2
ADC.ADC3 ADC channel 3
Constant Description
ADC.ADC0 ADC channel 0
ADC.ADC1 ADC channel 1
ADC.ADC2 ADC channel 2
Constant Description
ADC.ADC0 ADC channel 0
Constant Description
ADC.ADC0 ADC channel 0
Constant Description
ADC.ADC0 ADC channel 0
Constant Description
ADC.ADC0 ADC channel 0
ADC.ADC1 ADC channel 1
Constant Description
ADC.ADC0 ADC channel 0
ADC.ADC1 ADC channel 1
Constant Description
ADC.ADC0 ADC channel 0
ADC.ADC1 ADC channel 1
Constant Description
ADC.ADC0 ADC channel 0
ADC.ADC1 ADC channel 1
Constant Description
ADC.ADC0 ADC channel 0
ADC.ADC1 ADC channel 1
Constant Description
ADC.ADC0 ADC channel 0
ADC.ADC1 ADC channel 1
Constant Description
ADC.ADC0 ADC channel 0
ADC.ADC1 ADC channel 1
Constant Description
ADC.ADC0 ADC channel 0
ADC.ADC1 ADC channel 1
Constant Description
ADC.ADC0 ADC channel 0
ADC.ADC1 ADC channel 1
Constant Description
ADC.ADC0 ADC channel 0
ADC.ADC1 ADC channel 1
Constant Description
ADC.ADC0 ADC channel 0
ADC.ADC1 ADC channel 1
Constant Description
ADC.ADC0 ADC channel 0
ADC.ADC1 ADC channel 1
Constant Description
ADC.ADC0 ADC channel 0
ADC.ADC1 ADC channel 1
ADC.ADC2 ADC channel 2
Constant Description
ADC.ADC0 ADC channel 0
Constant Description
ADC.ADC0 ADC channel 0
Constant Description
ADC.ADC0 ADC channel 0
ADC.ADC1 ADC channel 1
Constant Description
ADC.ADC0 ADC channel 0
ADC.ADC1 ADC channel 1
型号选择: