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:

The corresponding pins of EC100Y series module are as follows:
ADC0 – pin39
ADC1 – pin81
The corresponding pin of EC600S/EC600N series module is as follows:
ADC0 – pin19
The corresponding pins of EC600M series module is as follows:
ADC0 – pin19
ADC1 – pin20
The corresponding pin of EC800N series module is as follows:
ADC0 – pin9
The corresponding pins of EC600U series module is as follows:
ADC0 – pin19
ADC1 – pin20
ADC2 – pin113
ADC3 – pin114
The corresponding pins of EC200U series module is as follows:
ADC0 – pin45
ADC1 – pin44
ADC2 – pin43
The corresponding pins of EC200A/UC200A series module is as follows:
ADC0 – pin45
ADC1 – pin44
The corresponding pin of BG95 series module is as follows:
ADC0 – pin24
The corresponding pins of EG915U series module is as follows:
ADC0 – pin24
ADC1 – pin2
The corresponding pins of EC800M/EG810M series module is as follows:
ADC0 – pin9
ADC1 – pin96
The corresponding pins of EG912N series module is as follows:
ADC0 – pin24
ADC1 – pin2
The corresponding pins of EG912U series module is as follows:
ADC0 – pin24
ADC1 – pin2

The corresponding pins of BC32 series module is as follows:
ADC0 – pin2

The corresponding pins of BC92 series module is as follows:
ADC0 – pin2

ADC.close

ADC.close()

Return Value:

0 - Successful execution

-1 - Failed execution

Constants

Constant Description Module
ADC.ADC0 ADC channel 0 EC600S/EC600N/EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC200A/EC600M/
EG915U/EC800M/EG912N/EG912U/BC32/BC92
ADC.ADC1 ADC channel 1 EC600U/EC200U/EC200A/EC600M/EG915U/EC800M/EG912N/EG912U
ADC.ADC2 ADC channel 2 EC600U/EC200U
ADC.ADC3 ADC channel 3 EC600U