public class TMP36 extends AnalogInputDevice implements TemperatureSensorInterface
listeners
pinNumber
Constructor and Description |
---|
TMP36(AnalogInputDeviceFactoryInterface deviceFactory,
int pinNumber,
float vRef,
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, disableListener, enableListener, getUnscaledValue, run
addListener, removeAllListeners, removeListener, valueChanged
getPinNumber
public TMP36(AnalogInputDeviceFactoryInterface deviceFactory, int pinNumber, float vRef, float tempOffset) throws RuntimeIOException
deviceFactory
- Device factory to use to construct the device.pinNumber
- Pin number on the ADC device.vRef
- Voltage range for the ADC - essential for scaled readings.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 TemperatureSensorInterface
RuntimeIOException
- If an I/O error occurred.Copyright © 2016 mattjlewis. All rights reserved.