libraries / Mitov / Mitov_TexasInstruments_Thermometer.hon commit Added link to project report (97a3ba0)
   1////////////////////////////////////////////////////////////////////////////////
   2//                                                                            //
   3//     This software is supplied under the terms of a license agreement or    //
   4//     nondisclosure agreement with Mitov Software and may not be copied      //
   5//     or disclosed except in accordance with the terms of that agreement.    //
   6//         Copyright(c) 2002-2016 Mitov Software. All Rights Reserved.        //
   7//                                                                            //
   8////////////////////////////////////////////////////////////////////////////////
   9
  10#ifndef _MITOV_TEXAS_INSTUMENTS_THERMOMETER_h
  11#define _MITOV_TEXAS_INSTUMENTS_THERMOMETER_h
  12
  13#include <Mitov.h>
  14
  15namespace Mitov
  16{
  17        class TexasInstruments_Thermometer : public Mitov::CommonFilter
  18        {
  19                typedef Mitov::CommonFilter inherited;
  20
  21        public:
  22                bool    InFahrenheit = false;
  23
  24        protected:
  25                virtual void DoReceive( void *_Data ) override
  26                {
  27                        float AValue = (*(float *)_Data) * 500;
  28
  29                        if( InFahrenheit )
  30                                AValue = AValue * ( 9.0/5.0 ) + 32.0;
  31
  32                        OutputPin.Notify( &AValue );
  33                }
  34
  35        };
  36
  37}
  38
  39#endif