public class Anemometer extends SensorTask
DataEvent.DATA_SOURCE_SPEED
.
The number of magnets defines the resolution of the instrument. With two magnets, you need a minimum sampling interval of about 1.5 seconds to achieve 1 MPH resolution. With 1 magnet, the resolution drops to 2 MPH unless you double the sampling interval.
Refer to this internal default resource file for property keys and default values used to configure this task. If a rain gauge is also installed, it will be necessary to specify an address to associate the correct DS2423 counter with each device.
Modifier and Type | Class and Description |
---|---|
private class |
Anemometer.ReadTask
Samples the DS2423 on the configured schedule.
|
Modifier and Type | Field and Description |
---|---|
private double |
cal
Calibration constant (nanoseconds / num.magnets).
|
private double[] |
coeffs
Calibration coefficients.
|
private com.dalsemi.onewire.container.OneWireContainer1D |
container
DS2423 memory sensor.
|
private int |
counterPage
Counter page address (counter 1 = 14, counter 2 = 15).
|
private static byte[] |
FAMILY
DS2423 memory sensor family code.
|
private long |
samplingInterval
Sampling interval in milliseconds.
|
adapter, address, cancel, CFG_DEVICE_ADDRESS_KEY, CFG_DEVICE_CHANNEL_KEY, CFG_DEVICE_OFFSET_KEY, CFG_DEVICE_SCALE_KEY, CFG_SAMPLING_INTERVAL_KEY, config, dataExchange, LOGGER, name, ONE_WIRE_TIMEOUT, population, SENSOR_TIMEOUT
Constructor and Description |
---|
Anemometer(java.lang.String name,
com.dalsemi.onewire.adapter.DSPortAdapter adapter,
java.util.Properties config,
IDataExchange dataExchange,
IServiceControl serviceControl)
Creates a new instance of Anemometer
|
beginExclusive, curveFit, doADConvertEFT, doADConvertEFT, doTemperatureConvertEFT, endExclusive, findContainerEFT, findContainerEFT, findContainerEFT, getADVoltageEFT, getADVoltageEFT, getTemperatureEFT, readBytesEFT, readCounterEFT, readDeviceEFT, readFileEFT, setMaxTemperatureResolutionEFT, stdDev, toHexString, toString, writeByteEFT, writeDeviceEFT
private static final byte[] FAMILY
private com.dalsemi.onewire.container.OneWireContainer1D container
private double cal
private double[] coeffs
private long samplingInterval
private int counterPage
public Anemometer(java.lang.String name, com.dalsemi.onewire.adapter.DSPortAdapter adapter, java.util.Properties config, IDataExchange dataExchange, IServiceControl serviceControl)
name
- of this sensor task.adapter
- 1-Wire adapter.config
- configuration properties.dataExchange
- to notify with new data.serviceControl
- to schedule the task.