Part One of my Project Course. Implementation of simple I/O and a custom defined protocol over UDP/IP.
Dependencies: C12832 LM75B mbed EthernetInterface mbed-rtos
temperature.cpp
- Committer:
- bertgereels
- Date:
- 2018-03-23
- Revision:
- 3:538e17979246
- Parent:
- 0:88d3b9015f7c
File content as of revision 3:538e17979246:
#include "mbed.h" #include "LM75B.h" #include "C12832.h" #include "temperature.h" namespace ProjectOne{ Temperature::Temperature(PinName firstPin, PinName secondPin) : sensor(firstPin,secondPin){ } float Temperature::readTemperature(void){ if (sensor.open()) { return (float)sensor.temp(); }else{ return -1; } } }