public class TiDHT extends Object implements ITiEventListener
| Constructor and Description |
|---|
TiDHT(TiGPIO gpio,
int dataPinID)
TiDHT initialization, default:model=DHT11
|
TiDHT(TiGPIO gpio,
int dataPinID,
boolean model22)
TiDHT initialization
|
| Modifier and Type | Method and Description |
|---|---|
int |
getDataPinID()
Gets the data pin id
|
double |
getHumidity()
Get the humidity
|
double |
getTemperature()
Get the temperature
|
TiEventType |
getType()
the event type of the listener
|
void |
measure()
Startup humiture measurement
|
void |
onEvent(ITiEvent evt)
triggered when the event occurs
|
public TiDHT(TiGPIO gpio, int dataPinID) throws IOException
gpio - TiGPIO object[IN]dataPinID - data pin id[IN]IOExceptionpublic TiDHT(TiGPIO gpio, int dataPinID, boolean model22) throws IOException
gpio - TiGPIO object[IN]dataPinID - data pin id[IN]model22 - true:DHT22, false:DHT11IOExceptionpublic int getDataPinID()
public double getHumidity()
public double getTemperature()
public TiEventType getType()
ITiEventListenergetType in interface ITiEventListenerpublic void measure()
throws IOException
IOExceptionpublic void onEvent(ITiEvent evt)
ITiEventListeneronEvent in interface ITiEventListenerevt - event object