public class McpAdc extends AbstractDeviceFactory implements AnalogInputDeviceFactoryInterface
Modifier and Type | Class and Description |
---|---|
static class |
McpAdc.McpAdcBoardPinInfo |
static class |
McpAdc.Type
The MCP3204/3208 devices offer the choice of using the analog input channels configured
as single-ended inputs or pseudo-differential pairs.
|
Modifier and Type | Field and Description |
---|---|
static McpAdc.Type |
MCP3001 |
static McpAdc.Type |
MCP3002 |
static McpAdc.Type |
MCP3004 |
static McpAdc.Type |
MCP3008 |
static McpAdc.Type |
MCP3201 |
static McpAdc.Type |
MCP3202 |
static McpAdc.Type |
MCP3204 |
static McpAdc.Type |
MCP3208 |
static McpAdc.Type |
MCP3301 |
static McpAdc.Type |
MCP3302 |
static McpAdc.Type |
MCP3304 |
closed, deviceStates
Constructor and Description |
---|
McpAdc(McpAdc.Type type,
int chipSelect,
float vRef) |
McpAdc(McpAdc.Type type,
int controller,
int chipSelect,
float vRef) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
AnalogInputDeviceInterface |
createAnalogInputDevice(String key,
PinInfo pinInfo) |
BoardPinInfo |
getBoardPinInfo() |
String |
getName() |
float |
getValue(int adcPin)
Read the analog value in the range 0..1 or -1..1 (if the ADC type is signed)
|
float |
getVRef() |
createPinKey, deviceClosed, deviceOpened, getDevice, isClosed, isDeviceOpened
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
provisionAnalogInputDevice
createPinKey, deviceClosed, deviceOpened, isClosed, isDeviceOpened
public static final McpAdc.Type MCP3001
public static final McpAdc.Type MCP3002
public static final McpAdc.Type MCP3004
public static final McpAdc.Type MCP3008
public static final McpAdc.Type MCP3201
public static final McpAdc.Type MCP3202
public static final McpAdc.Type MCP3204
public static final McpAdc.Type MCP3208
public static final McpAdc.Type MCP3301
public static final McpAdc.Type MCP3302
public static final McpAdc.Type MCP3304
public McpAdc(McpAdc.Type type, int chipSelect, float vRef) throws RuntimeIOException
RuntimeIOException
public McpAdc(McpAdc.Type type, int controller, int chipSelect, float vRef) throws RuntimeIOException
RuntimeIOException
public float getVRef()
getVRef
in interface AnalogInputDeviceFactoryInterface
public void close() throws RuntimeIOException
close
in interface DeviceFactoryInterface
close
in interface Closeable
close
in interface AutoCloseable
close
in class AbstractDeviceFactory
RuntimeIOException
public float getValue(int adcPin) throws RuntimeIOException
adcPin
- Pin on the MCP deviceRuntimeIOException
- if an I/O error occurspublic AnalogInputDeviceInterface createAnalogInputDevice(String key, PinInfo pinInfo) throws RuntimeIOException
createAnalogInputDevice
in interface AnalogInputDeviceFactoryInterface
RuntimeIOException
public String getName()
getName
in interface DeviceFactoryInterface
public BoardPinInfo getBoardPinInfo()
getBoardPinInfo
in interface DeviceFactoryInterface
Copyright © 2016–2017 mattjlewis. All rights reserved.