public class MCP3424GpioProvider extends AdcGpioProviderBase implements AdcGpioProvider
This GPIO provider implements the MCP3424 I2C GPIO expansion board as native Pi4J GPIO pins. It is a 18-bit ADC providing 4 sigma/delta input channels. More information about the board can be found here: http://ww1.microchip.com/downloads/en/DeviceDoc/22088c.pdf
The MCP3424 is connected via I2C connection to the Raspberry Pi and provides 4 analog input channels. The values returned are in the range [-131072:131071] (max 18 bit value).
| Modifier and Type | Field and Description |
|---|---|
static String |
DESCRIPTION |
static String |
NAME |
allPins, conversionDelay, monitor, monitorInterval, thresholdcache, DEFAULT_CACHE_SIZE, isshutdown, listenersDEFAULT_MONITOR_INTERVAL, DEFAULT_THRESHOLD, INVALID_VALUE, MIN_MONITOR_INTERVAL| Constructor and Description |
|---|
MCP3424GpioProvider(I2CBus bus,
int address) |
MCP3424GpioProvider(I2CBus bus,
int address,
int resolution,
int gain) |
MCP3424GpioProvider(int busNumber,
int address) |
MCP3424GpioProvider(int busNumber,
int address,
int resolution,
int gain) |
| Modifier and Type | Method and Description |
|---|---|
double |
getAnalogValue(GpioPinAnalogInput pin)
Get the requested analog input pin's conversion value.
|
double |
getAnalogValue(Pin pin)
Get the requested analog input pin's conversion value.
|
double |
getImmediateValue(Pin pin)
This method will perform an immediate data acquisition directly to the ADC chip to get the requested pin's input
conversion value.
|
double |
getMaxSupportedValue()
Get the maximum supported analog value for the ADC implementation.
|
double |
getMinSupportedValue()
Get the minimum supported analog value for the ADC implementation.
|
String |
getName() |
void |
setGain(int gain) |
void |
setResolution(int resolution) |
void |
shutdown()
This method is used by the framework to shutdown the
background monitoring thread if needed when the program exits.
|
getEventThreshold, getEventThreshold, getImmediateValue, getMonitorEnabled, getMonitorInterval, getPercentValue, getPercentValue, getValue, setEventThreshold, setEventThreshold, setMonitorEnabled, setMonitorIntervaladdListener, dispatchPinAnalogValueChangeEvent, dispatchPinDigitalStateChangeEvent, export, export, getMode, getPinCache, getPullResistance, getPwm, getState, hasPin, isExported, isShutdown, removeAllListeners, removeListener, setMode, setPullResistance, setPwm, setPwmRange, setState, setValue, unexportclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEventThreshold, getEventThreshold, getImmediateValue, getMonitorEnabled, getMonitorInterval, getPercentValue, getPercentValue, setEventThreshold, setEventThreshold, setMonitorEnabled, setMonitorIntervaladdListener, export, export, getMode, getPullResistance, getPwm, getState, getValue, hasPin, isExported, isShutdown, removeAllListeners, removeListener, setMode, setPullResistance, setPwm, setPwmRange, setState, setValue, unexportpublic static final String NAME
public static final String DESCRIPTION
public MCP3424GpioProvider(int busNumber,
int address)
throws I2CFactory.UnsupportedBusNumberException,
IOException
public MCP3424GpioProvider(int busNumber,
int address,
int resolution,
int gain)
throws I2CFactory.UnsupportedBusNumberException,
IOException
public MCP3424GpioProvider(I2CBus bus, int address) throws I2CFactory.UnsupportedBusNumberException, IOException
public MCP3424GpioProvider(I2CBus bus, int address, int resolution, int gain) throws I2CFactory.UnsupportedBusNumberException, IOException
public void setGain(int gain)
throws IllegalArgumentException
IllegalArgumentExceptionpublic void setResolution(int resolution)
throws IllegalArgumentException
IllegalArgumentExceptionpublic void shutdown()
AdcGpioProviderBaseshutdown in interface GpioProvidershutdown in class AdcGpioProviderBasepublic String getName()
getName in interface GpioProvidergetName in class GpioProviderBasepublic double getAnalogValue(Pin pin)
pin - to get conversion values forpublic double getAnalogValue(GpioPinAnalogInput pin)
pin - to get conversion values forpublic double getImmediateValue(Pin pin) throws IOException
getImmediateValue in interface AdcGpioProvidergetImmediateValue in class AdcGpioProviderBasepin - requested input pin to acquire conversion valueIOExceptionpublic double getMinSupportedValue()
getMinSupportedValue in interface AdcGpioProviderpublic double getMaxSupportedValue()
getMaxSupportedValue in interface AdcGpioProviderCopyright © 2012–2018 Pi4J. All rights reserved.