![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Kévin
Diff: main.cpp
- Revision:
- 0:1090ec9f109d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Oct 13 13:15:22 2017 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" +#include "DHT.h" + +Serial sig (PA_0, PA_1, 9600); +DHT sensor(D6,SEN51035P); // Use the SEN11301P sensor + +int main() { + for(int i=0; i<5; i++) { + int err; + int val; + err = sensor.readData(); + if(err == 0){ + val = (int) sensor.ReadTemperature(CELCIUS); + sig.printf("AT$SS=%02x\r\n",val); + val = (int) sensor.ReadHumidity(); + sig.printf("AT$SS=%02x\r\n",val); + } + wait(20); + } +} +