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 4:efa40de4c07e, committed 2020-02-06
- Comitter:
- flozada
- Date:
- Thu Feb 06 22:18:39 2020 +0000
- Parent:
- 3:cd7804120497
- Commit message:
- PROTOTIPO CODIGO CON SENSOR DHT11_ TEMPERATURA Y HUMEDAD
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Jan 07 22:34:55 2017 +0000
+++ b/main.cpp Thu Feb 06 22:18:39 2020 +0000
@@ -1,8 +1,8 @@
#include "mbed.h"
#include "DHT.h"
-
-DHT sensor(D7, DHT22);
+Serial device(PA_2,PA_3);
+DHT sensor(PD_7, DHT22);
int main()
{
@@ -13,17 +13,18 @@
wait(2.0f);
error = sensor.readData();
if (0 == error) {
+ device.baud(115200);
c = sensor.ReadTemperature(CELCIUS);
f = sensor.ReadTemperature(FARENHEIT);
k = sensor.ReadTemperature(KELVIN);
h = sensor.ReadHumidity();
dp = sensor.CalcdewPoint(c, h);
dpf = sensor.CalcdewPointFast(c, h);
- printf("Temperature in Kelvin: %4.1f, Celcius: %4.1f, Farenheit %4.1f\n", k, c, f);
- printf("Humidity is %4.1f, Dewpoint: %4.1f, Dewpoint fast: %4.1f\n", h, dp, dpf);
- printf("\n");
+ device.printf("Temperature in Kelvin: %2.1f, Celcius: %2.1f, Farenheit %2.1f\n", k, c, f);
+ device.printf("Humidity is %2.1f, Dewpoint: %2.1f, Dewpoint fast: %2.1f\n", h, dp, dpf);
+ device.printf("\n");
} else {
- printf("Error: %d\n", error);
+ device.printf("Error: %d\n", error);
}
}
}
--- a/mbed.bld Sat Jan 07 22:34:55 2017 +0000 +++ b/mbed.bld Thu Feb 06 22:18:39 2020 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/99b5ccf27215 \ No newline at end of file +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file