
Get current temperature,
you can configure the format of the temperature in Celsius
or Fahrenheit.
function DHTGetTemperature(connName: ConnName, style: DHTTemStyle):
number;
Parameters
•
connName
is the connector's name.this module can be pluged into both analog
connector and digital connector.
•
style
is the format of the temperature.you can choose Celsius or Fahrenheit.
Get humidity
獲得當前濕度。
Get current humidity.
function DHTGetHumidity(connName: ConnName): number;
Parameters
•
connName
is the connector's name.this module can be pluged into both analog
connector and digital connector.
Temperature change event
配置
MCU
定期檢查溫度,然後在溫度變化時執行相應的代碼塊。最小單位變化為
1
攝氏度。
Configure the MCU check the temperature periodically, and then execute the
associated code block whenever the temperature changes.The smallest unit of
changing is 1 degrees Celsius.
function onDHTEvent(connName: ConnName, body: () => void): void;