HIH-4030 fork to handle 3.3v input voltage

Fork of HIH-4030 by Simon Barker

hih-4030.cpp

Committer:
ddollar
Date:
2013-08-11
Revision:
1:f0ae84350631
Parent:
0:114b50b41972

File content as of revision 1:f0ae84350631:

#include "hih-4030.h"

HIH4030::HIH4030(PinName pin) {
  m_analog_in = new AnalogIn(pin);
}

float HIH4030::sensorRH(){
  return (((m_analog_in->read() * 3.3) - 0.631) / 0.0307);
}

float HIH4030::trueSensorRH(float temperature){
  return (sensorRH() / (1.0546 - (temperature * 0.00216)));
}