status 0 temperature sensor

Dependencies:   DHT DHT11 mbed

tempSensor.cpp

Committer:
y_xu13
Date:
2018-01-25
Revision:
0:26de26537aaf

File content as of revision 0:26de26537aaf:

/*#include "mbed.h"
#include <iostream>
#include "Dht11.h"
//use namespace std;

    Serial pc(USBTX, USBRX);
    Dht11 tempSensor(PTC7);

int main(){
    int status = tempSensor.read();
    while(1){
        pc.printf("Status %i, t: %i\n", status, tempSensor.getCelsius());
    } 
}
*/
 #include "mbed.h"
 #include "Dht11.h"
 
 Serial pc(USBTX, USBRX);
 Dht11 sensor(PTC7);
 
 int main() {
     int status =sensor.read();
     while(1){
     pc.printf("Status %i, T: %f, H: %d\r\n", sensor.getFahrenheit(), sensor.getHumidity());
     }
 }