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:
- dantecarrillo
- Date:
- 2022-06-16
- Revision:
- 2:e443fb501fa4
- Parent:
- 0:c12c28a0f9e7
File content as of revision 2:e443fb501fa4:
#include "mbed.h" #include "DHT.h" DHT sensor(PA_0, DHT11); int main() { int error = 0; float h = 0.0f, c = 0.0f, f = 0.0f, k = 0.0f; while(1) { wait(2.0f); error = sensor.readData(); if (0 == error) { c = sensor.ReadTemperature(CELCIUS); f = sensor.ReadTemperature(FARENHEIT); k = sensor.ReadTemperature(KELVIN); h = sensor.ReadHumidity(); printf("Kelvin: %4.2f, Celcius: %4.2f, Farenheit %4.2f\n", k, c, f); printf("Humedad %4.2f", h); } else { printf("Error: %d\n", error); } } }