Code for sensor nodes connected by radio receiver with gateway

Dependencies:   mbed WakeUp coapRadioClient DHT11

Committer:
Ka_myk
Date:
Fri Jan 25 12:11:18 2019 +0000
Revision:
7:2393eb882f82
Parent:
3:4ffffdb5230f
inrement message id

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Ka_myk 0:4c0d384fd5cf 1 //
Ka_myk 0:4c0d384fd5cf 2 // Created by Kamil Mykitiuk on 2019-01-21.
Ka_myk 0:4c0d384fd5cf 3 //
Ka_myk 0:4c0d384fd5cf 4
Ka_myk 0:4c0d384fd5cf 5 #include "humidityMeter.h"
Ka_myk 0:4c0d384fd5cf 6 #include "dbg.h"
Ka_myk 0:4c0d384fd5cf 7
Ka_myk 0:4c0d384fd5cf 8 int HumidityMeter::read() {
Ka_myk 3:4ffffdb5230f 9 int s = dht->readData();
Ka_myk 0:4c0d384fd5cf 10 if (s != DHT11::OK) {
Ka_myk 1:c3b4feacfb6c 11 return s * -1;
Ka_myk 0:4c0d384fd5cf 12 } else {
Ka_myk 3:4ffffdb5230f 13 return dht->readHumidity();
Ka_myk 0:4c0d384fd5cf 14 }
Ka_myk 0:4c0d384fd5cf 15
Ka_myk 0:4c0d384fd5cf 16 }
Ka_myk 0:4c0d384fd5cf 17
Ka_myk 0:4c0d384fd5cf 18 int HumidityMeter::getSensorId() {
Ka_myk 0:4c0d384fd5cf 19 return 1;
Ka_myk 0:4c0d384fd5cf 20 }
Ka_myk 0:4c0d384fd5cf 21
Ka_myk 0:4c0d384fd5cf 22 void HumidityMeter::initialize() {
Ka_myk 0:4c0d384fd5cf 23 DBG("Sensor initialized");
Ka_myk 0:4c0d384fd5cf 24 }