sht21 nucleo 073
Dependencies: SHT21_ncleee mbed
Diff: main.cpp
- Revision:
- 0:c65ff4c522cf
diff -r 000000000000 -r c65ff4c522cf main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Oct 30 07:55:14 2018 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" +#include "SHT21_ncleee.h" + +DigitalOut led(LED2); +I2C i2c(I2C_SDA,I2C_SCL); +SHT21 sht(&i2c); + +int main() +{ + while(1) { + led = 1; // LED is ON + wait(0.2); // 200 ms + led = 0; // LED is OFF + wait(0.8); // 800 ms + + printf("Hello World...\n\tTesting temperature Sensor\n"); + int temperature = sht.readTemp(); + printf("Temperature is: %d \n", temperature); + printf("Experiment complete...\n"); + int humidity= sht.readHumidity(); + printf("Vlajnost: %d \n",humidity); + + } +}