Uploading sensor data (voltage divider, MAX4172, INA219) over Ethernet to Thing Speak service. Uses old mbed revision that is compatible with NetServices library. I2C communication is made with I2CR library.

Dependencies:   C12832 I2CR INA219 NetServices mbed

Fork of NetServices_HelloWorld by Segundo Equipo

Sensor.cpp

Committer:
tsoic
Date:
2015-11-29
Revision:
7:1da0a084cd69
Parent:
6:ebbde59c5a1d

File content as of revision 7:1da0a084cd69:

#include "Sensor.h"
#include "mbed.h"

Sensor::Sensor(PinName sensorPin, float Koef) : sensorInput(sensorPin), K(Koef) { 

} 

float Sensor::read() {
        readVal[0] = sensorInput;
        realVal = readVal[0]; //* Računanje srednje vrijednosti
        return realVal  *= K;
         
}