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.
Revision 0:f2be568faec6, committed 2019-05-12
- Comitter:
- pablolopez89
- Date:
- Sun May 12 01:50:01 2019 +0000
- Commit message:
- Sensor de Humedad y Temperatura dht22
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DHT.lib Sun May 12 01:50:01 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/Wimpie/code/DHT/#9b5b3200688f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sun May 12 01:50:01 2019 +0000
@@ -0,0 +1,32 @@
+#include "mbed.h"
+#include "DHT.h"
+
+DigitalOut myled(LED1);
+
+DHT sensor(PA_0,DHT22); // Use the SENdht22 sensor
+
+Serial PC(USBTX, USBRX);//Serial LOG
+
+int main() {
+ int err;
+ PC.printf("\r\nDHT Test program");
+ PC.printf("\r\n******************\r\n");
+ wait(1); // wait 1 second for device stable status
+ while (1) {
+ myled = 1;
+ err = sensor.readData();
+ if (err == 0) {
+ PC.printf("Temperature is %4.2f C \r\n",sensor.ReadTemperature(CELCIUS));
+ //PC.printf("Temperature is %4.2f F \r\n",sensor.ReadTemperature(FARENHEIT));
+ //PC.printf("Temperature is %4.2f K \r\n",sensor.ReadTemperature(KELVIN));
+ PC.printf("Humidity is %4.2f \r\n",sensor.ReadHumidity());
+ //PC.printf("Dew point is %4.2f \r\n",sensor.CalcdewPoint(sensor.ReadTemperature(CELCIUS), sensor.ReadHumidity()));
+ //PC.printf("Dew point (fast) is %4.2f \r\n",sensor.CalcdewPointFast(sensor.ReadTemperature(CELCIUS), sensor.ReadHumidity()));
+ }
+ // else
+ // PC.printf("\r\nErr %i \n",err);
+ myled = 0;
+ wait(1);
+ }
+
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun May 12 01:50:01 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file