![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
status 0 temperature sensor
Diff: tempSensor.cpp
- Revision:
- 0:26de26537aaf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tempSensor.cpp Thu Jan 25 16:35:31 2018 +0000 @@ -0,0 +1,27 @@ +/*#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()); + } + } \ No newline at end of file