DHT_CANSAT

Dependencies:   DHT22 mbed

Fork of DHT_TEST2 by mohamed gamal

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "DHT22.h"
00003 DHT22 dht22(p23);
00004 int main() {
00005     int hum;
00006     int temp;
00007     printf("Start\n");
00008     printf("\r\nSetting up...\r\n");
00009     while (1) {
00010         dht22.sample() ;
00011         hum=dht22.getHumidity()/10.0;
00012         temp=dht22.getTemperature()/10.0;
00013         printf("temp: %d  , hum:%d    ",temp,hum);
00014         wait(1);
00015         }}