Code for sensor nodes connected by radio receiver with gateway

Dependencies:   mbed WakeUp coapRadioClient DHT11

humidityMeter.cpp

Committer:
Ka_myk
Date:
22 months ago
Revision:
7:2393eb882f82
Parent:
3:4ffffdb5230f

File content as of revision 7:2393eb882f82:

//
// Created by Kamil Mykitiuk on 2019-01-21.
//

#include "humidityMeter.h"
#include "dbg.h"

int HumidityMeter::read() {
    int s = dht->readData();
    if (s != DHT11::OK) {
        return s * -1;
    } else {
        return dht->readHumidity();
    }

}

int HumidityMeter::getSensorId() {
    return 1;
}

void HumidityMeter::initialize() {
    DBG("Sensor initialized");
}