Drivers for temperature and humidity sensor SHF15. Modified for EDE_PRO2_team1

Dependencies:   SHTx mbed

Fork of PRO2_SHT15_Example by Olga Høyer

main.cpp

Committer:
OlgaHoeyer
Date:
2017-05-09
Revision:
2:4fba73b78e1c
Parent:
1:4c7450d9de9d
Child:
3:0759c60f116b

File content as of revision 2:4fba73b78e1c:

/**
 * Copyright (c) 2010 Roy van Dam <roy@negative-black.org>
**/

#include "mbed.h"
#include "SHTx/sht15.hpp"

//GLOBAL VARIABLES:
float temperature, humidity;
void GetTemperatureAndHumidity();

Serial pc(USBTX, USBRX);
DigitalOut busy(LED1);                  //Don't think we need it.

//ports on the Nucleo: PB_8, PB_9
SHTx::SHT15 sensor(PB_8, PB_9);


int
main()
{
    GetTemperatureAndHumidity();
}

void GetTemperatureAndHumidity()
// Speed things up a bit.
sensor.setOTPReload(false);
sensor.setResolution(true);

while(1)
{
    busy = true;
    sensor.update();
    busy = false;

    // Temperature in celcius
    sensor.setScale(false);
    Temperature=sensor.getTemperature();        //don't know if it works

    // Relative Humidity
    Humdity=sensor.getHumidity();               //don't know if it works

    wait(5);
    return ();
}