Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- HeptaSatTraining2019
- Date:
- 2019-11-06
- Revision:
- 0:d743365e4ee4
File content as of revision 0:d743365e4ee4:
#include "mbed.h"
#include "Dht11.h"
Serial pc(USBTX, USBRX);
Dht11 sensor(p15);
int temp,humid;
int main() {
while(1){
sensor.read();
temp = sensor.getFahrenheit();
humid = sensor.getHumidity();
temp = (temp - 32.0)/1.80; // Fahrenheit --> Celsius
pc.printf("T: %d, H: %d\r\n", temp, humid);
wait(1.0);
}
}