This is a very basic (hopefully easily understandeable) program to send the data bits of a DHT11 temperature and humidity sensor through Nucleo UART. It is a simple step-by-step guide to build the program.

Dependencies:   mbed

Fork of DHT11_with_Nucleo by Adatgy2014

Revision:
2:4469aa7f4995
Parent:
1:c0c5b5860aa8
Child:
3:6228ab73d420
--- a/main.cpp	Mon Jan 05 22:48:28 2015 +0000
+++ b/main.cpp	Tue Jan 06 00:01:51 2015 +0000
@@ -1,12 +1,21 @@
 #include "mbed.h"
 
-DigitalOut myled(LED1);
-DigitalIn mybutton(USER_BUTTON);
+DigitalOut myled(LED1); // Activate LED
+DigitalIn mybutton(USER_BUTTON); // Activate button
+DigitalInOut data_pin(A0); // Activate digital in
 
 int main() {
     while(1) {
         if (mybutton == 0) { // Button is pressed
             myled = 1; // LED is ON
+            data_pin.output(); // Set A0 as output
+            // Initialize measurement > 18 ms low
+            data_pin = 0;
+            wait_ms(20);
+            // After high and release the pin switch input mode
+            data_pin = 1;
+            data_pin.input();
+            wait_ms(200); // Wait 0.2 sec till continue.
         } else {
             myled = 0; // LED is OFF
         }