public class TiADC extends Object
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the port of current object
|
int |
getPort()
Gets the port id of current object
|
int |
getRawValue(int channelID)
Turn on conversion and gets the raw value
|
double |
getRefVoltageValue()
Gets the reference voltage value
|
int |
getResolutionValue(boolean pow)
Gets the resolution value
|
double |
getVoltageValue(int channelID)
Turn on conversion and gets the voltage value
|
static TiADC |
open(int portID,
int... channelIDs)
Open the TiADC port by port id and the channel list, and return the object
|
static int |
portNumber()
Maximum number of port supported
|
void |
setRefVoltageValue(double refVoltage,
double volDivision)
Set the reference voltage value and voltage division
|
public void close() throws IOException
IOException
- If a TiADC error occurspublic int getPort()
public int getRawValue(int channelID) throws IOException
channelID
- the channel id, range:0-15IOException
- If a TiADC error occurspublic double getRefVoltageValue()
public int getResolutionValue(boolean pow)
pow
- resolution powerpublic double getVoltageValue(int channelID) throws IOException
channelID
- the channel id, range:0-15IOException
- If a TiADC error occurspublic static TiADC open(int portID, int... channelIDs) throws IOException
portID
- the port IdchannelIDs
- channel id use, id range:0-15IOException
- If a TiADC error occurspublic static int portNumber()
public void setRefVoltageValue(double refVoltage, double volDivision)
refVoltage
- voltage value, unit:V, default:3.3VvolDivision
- voltage division, default:1.0