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]IOException
public TiDHT(TiGPIO gpio, int dataPinID, boolean model22) throws IOException
gpio
- TiGPIO object[IN]dataPinID
- data pin id[IN]model22
- true:DHT22, false:DHT11IOException
public int getDataPinID()
public double getHumidity()
public double getTemperature()
public TiEventType getType()
ITiEventListener
getType
in interface ITiEventListener
public void measure() throws IOException
IOException
public void onEvent(ITiEvent evt)
ITiEventListener
onEvent
in interface ITiEventListener
evt
- event object