Bert Gereels / Mbed 2 deprecated ProjectOne

Dependencies:   C12832 LM75B mbed EthernetInterface mbed-rtos

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers temperature.cpp Source File

temperature.cpp

00001 #include "mbed.h"
00002 #include "LM75B.h"
00003 #include "C12832.h"
00004 #include "temperature.h"
00005 
00006 namespace ProjectOne{
00007     
00008     Temperature::Temperature(PinName firstPin, PinName secondPin) : sensor(firstPin,secondPin){
00009         
00010     }
00011 
00012     float Temperature::readTemperature(void){
00013         if (sensor.open()) {
00014             return (float)sensor.temp();
00015         }else{
00016             return -1;
00017         }
00018     }
00019 
00020 }