Penn Electric Racing / Mbed 2 deprecated SystemManagement

Dependencies:   mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP

Fork of SystemManagement by Martin Deng

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Temperature.h Source File

Temperature.h

00001 #ifndef __TEMPERATURE_H
00002 #define __TEMPERATURE_H
00003 
00004 #include "mbed.h"
00005 
00006 typedef struct LOOKUP_TABLE_T {
00007     float *input;    
00008     float *output;
00009     int numEntries;
00010 } LOOKUP_TABLE_T;
00011 
00012 extern LOOKUP_TABLE_T NXFT15XH103_TABLE;
00013 
00014 class Temperature {
00015 public:
00016     Temperature(LOOKUP_TABLE_T *_table, PinName _pin);
00017     float readRaw();
00018     float read();
00019 #ifdef MBED_OPERATORS
00020     operator float() {
00021         return read();
00022     }
00023 #endif
00024 private:
00025     float convert(float reading);
00026     LOOKUP_TABLE_T *table;
00027     AnalogIn pin;
00028 };
00029 
00030 #endif