public class TMP36 extends AnalogInputDevice implements ThermometerInterface
gpio
Constructor and Description |
---|
TMP36(AnalogInputDeviceFactoryInterface deviceFactory,
int gpio,
float tempOffset) |
Modifier and Type | Method and Description |
---|---|
float |
getScaledValue()
Get the scaled value in the range 0..range (if unsigned) or -range..range
(if signed)
|
float |
getTemperature()
Get the current temperature in °C.
|
addListener, addListener, close, disableDeviceListener, enableDeviceListener, getUnscaledValue, getVRef, run
addListener, removeAllListeners, removeListener, valueChanged
getGpio
public TMP36(AnalogInputDeviceFactoryInterface deviceFactory, int gpio, float tempOffset) throws RuntimeIOException
deviceFactory
- Device factory to use to construct the device.gpio
- GPIO on the ADC device.tempOffset
- Compensate for potential temperature reading variations between different TMP36 devices.RuntimeIOException
- If an I/O error occurred.public float getScaledValue() throws RuntimeIOException
AnalogInputDevice
getScaledValue
in class AnalogInputDevice
RuntimeIOException
- if there was an I/O errorpublic float getTemperature() throws RuntimeIOException
getTemperature
in interface ThermometerInterface
RuntimeIOException
- If an I/O error occurred.Copyright © 2016–2017 mattjlewis. All rights reserved.