testing to print % character. DONE

Dependencies:   DHT mbed

Fork of TestingDHT22sensor by E2I4-PL1-DDVT

main.cpp

Committer:
alexandreturrel
Date:
2018-09-18
Revision:
4:a5d7a7910e35
Parent:
3:6b640fc3ef2a

File content as of revision 4:a5d7a7910e35:

#include "mbed.h"
#include "DHT.h"


DigitalOut myled(LED1);
DigitalOut Error(LED2);
DHT dht22(D4,DHT22);  

int main() {
    printf("Starting!!!\r\n");
    wait(1);
    while(1) {
       int err=dht22.readData();
       if (err==0) {
          Error=0; 
          printf("T: %.1f C",dht22.ReadTemperature(CELCIUS));
          printf(" H %.1f",dht22.ReadHumidity());
          printf("%%");
          printf("\n\r");
       }
       else {
         Error=1;
         dht22.printErr(err);
       }  

        myled = 1;
        wait(10);
        myled = 0;

    }
}