public interface AnalogInput extends PinFeature
| Modifier and Type | Method and Description |
|---|---|
double |
read()
Reads the voltage that is currently applied to the pin.
|
double[] |
sample(int amountSamples)
Grabs a number of readings from the analog input in short succession.
|
double[] |
sample(int amountSamples,
float frequency)
Grabs a number of readings from the analog input, sampled
with the specified frequency.
|
Future<double[]> |
sampleAsync(int amountSamples)
Grabs a number of readings asynchronously from the analog input
in short succession.
|
Future<double[]> |
sampleAsync(int amountSamples,
float frequency)
Grabs a number of readings asynchronously from the analog input,
sampled with the specified frequency.
|
void |
startMonitor(int periodMicroSeconds,
ThresholdListener listener)
Start a monitor on the analog input.
|
void |
stopMonitor()
Stops the monitor that currently listens on the pin.
|
activate, blockPin, getName, getPin, isActivatedFeature, isBlocking, isSetup, isTorndownOnShutdown, setTeardownOnShutdown, setup, teardown, unblockPindouble read()
double[] sample(int amountSamples)
amountSamples - the amount samples to be takendouble[] sample(int amountSamples,
float frequency)
amountSamples - the amount samples to be takenfrequency - the frequency that should be used for samplingFuture<double[]> sampleAsync(int amountSamples)
amountSamples - the amount samples to be takenFuture<double[]> sampleAsync(int amountSamples, float frequency)
amountSamples - the amount samples to be takenfrequency - the frequency that should be used for samplingvoid startMonitor(int periodMicroSeconds,
ThresholdListener listener)
thresholdReached
method will be called.periodMicroSeconds - the period micro secondslistener - the listenervoid stopMonitor()
Copyright © 2015 silverspoon.io. All rights reserved.