hcsr04_dht11 sicakliga gore degisim
Dependencies: mbed HCSR04 DHT11
main.cpp
- Committer:
- marvas
- Date:
- 2019-12-28
- Revision:
- 0:c9bfe6d29b7f
File content as of revision 0:c9bfe6d29b7f:
#include "mbed.h" #include "DHT11.h" #include "hcsr04.h" Timer t; HCSR04 sensor(PA_9, PA_8); DHT11 sinyal_pini(PB_13); long sicaklik; int main() { t.start(); while(1) { long mesafe = sensor.distance(sicaklik); printf("Mesafe %d\n ",mesafe); wait_us(15); if(t.read()>2) { sinyal_pini.readData(); sicaklik=sinyal_pini.readTemperature(); printf("Sicaklik:%d,Nem:%d \n", sicaklik,sinyal_pini.readHumidity()); t.reset(); } } }